@project-sunbird/collection-editor-react 1.0.15 → 1.0.16-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +25 -0
  2. package/dist/api/competencyFramework.d.ts +32 -0
  3. package/dist/collection-editor.umd.js +109 -109
  4. package/dist/components/SparkMetaForm/fields/OptionSearch.d.ts +20 -0
  5. package/dist/components/SparkMetaForm/fields/OptionSearch.test.d.ts +1 -0
  6. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.competency.test.d.ts +1 -0
  7. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.d.ts +34 -1
  8. package/dist/components/SparkMetaForm/hooks/useFieldPrepare.skill.test.d.ts +1 -0
  9. package/dist/components/UnitContentList/LevelCourseItem.d.ts +11 -0
  10. package/dist/components/UnitContentList/LevelExamItem.d.ts +7 -0
  11. package/dist/hooks/useCompetencyFrameworks.d.ts +27 -0
  12. package/dist/hooks/useCourseCompetency.d.ts +31 -0
  13. package/dist/hooks/useCourseCompetency.test.d.ts +1 -0
  14. package/dist/hooks/useLevelExam.d.ts +18 -0
  15. package/dist/hooks/useLibrary.d.ts +98 -16
  16. package/dist/hooks/useLpCompetency.d.ts +13 -0
  17. package/dist/hooks/useSkillCategory.d.ts +15 -1
  18. package/dist/hooks/useSkillScope.d.ts +4 -3
  19. package/dist/hooks/useSkillsCoveredSync.d.ts +10 -0
  20. package/dist/hooks/useSkillsCoveredSync.test.d.ts +1 -0
  21. package/dist/i18n/locales/ar.json.d.ts +59 -27
  22. package/dist/i18n/locales/en.json.d.ts +59 -27
  23. package/dist/i18n/locales/fr.json.d.ts +59 -27
  24. package/dist/i18n/locales/pt.json.d.ts +59 -27
  25. package/dist/index.cjs +112 -112
  26. package/dist/index.js +10882 -10103
  27. package/dist/store/tree.store.d.ts +5 -2
  28. package/dist/store/tree.store.dirty.test.d.ts +1 -0
  29. package/dist/store/ui.store.d.ts +2 -0
  30. package/dist/style.css +1 -1
  31. package/dist/types/framework.d.ts +27 -0
  32. package/dist/types/profile.d.ts +8 -1
  33. package/dist/utils/competencyLeaves.d.ts +44 -0
  34. package/dist/utils/competencyLeaves.test.d.ts +1 -0
  35. package/dist/utils/libraryCardMeta.d.ts +33 -0
  36. package/dist/utils/libraryCardMeta.test.d.ts +1 -0
  37. package/dist/utils/lpCompetency.d.ts +32 -0
  38. package/dist/utils/lpCompetency.test.d.ts +1 -0
  39. package/dist/utils/lpStructure.d.ts +78 -55
  40. package/dist/utils/skillTerms.d.ts +22 -0
  41. package/dist/utils/skillTerms.test.d.ts +1 -0
  42. package/package.json +1 -1
  43. package/dist/components/UnitContentList/SkillPicker.d.ts +0 -19
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var fm=Object.defineProperty;var ec=e=>{throw TypeError(e)};var hm=(e,t,r)=>t in e?fm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var ps=(e,t,r)=>hm(e,typeof t!="symbol"?t+"":t,r),Ro=(e,t,r)=>t.has(e)||ec("Cannot "+r);var k=(e,t,r)=>(Ro(e,t,"read from private field"),r?r.call(e):t.get(e)),ge=(e,t,r)=>t.has(e)?ec("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),X=(e,t,r,n)=>(Ro(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),De=(e,t,r)=>(Ro(e,t,"access private method"),r);var di=(e,t,r,n)=>({set _(s){X(e,t,s,r)},get _(){return k(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),xr=require("react-dom"),l=require("react/jsx-runtime");function pm(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Me=pm(g);var Ws=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},rn,Rr,qn,Pd,mm=(Pd=class extends Ws{constructor(){super();ge(this,rn);ge(this,Rr);ge(this,qn);X(this,qn,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){k(this,Rr)||this.setEventListener(k(this,qn))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Rr))==null||t.call(this),X(this,Rr,void 0))}setEventListener(t){var r;X(this,qn,t),(r=k(this,Rr))==null||r.call(this),X(this,Rr,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){k(this,rn)!==t&&(X(this,rn,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof k(this,rn)=="boolean"?k(this,rn):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},rn=new WeakMap,Rr=new WeakMap,qn=new WeakMap,Pd),hl=new mm,gm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hr,nn,Rd,vm=(Rd=class{constructor(){ge(this,hr,gm);ge(this,nn,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&k(this,nn)&&e!==k(this,hr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:k(this,hr),provider:e}),X(this,hr,e),process.env.NODE_ENV!=="production"&&X(this,nn,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&X(this,nn,!0),k(this,hr).setTimeout(e,t)}clearTimeout(e){k(this,hr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&X(this,nn,!0),k(this,hr).setInterval(e,t)}clearInterval(e){k(this,hr).clearInterval(e)}},hr=new WeakMap,nn=new WeakMap,Rd),Jr=new vm;function ym(e){setTimeout(e,0)}var bm=typeof window>"u"||"Deno"in globalThis;function Pt(){}function Cm(e,t){return typeof e=="function"?e(t):e}function va(e){return typeof e=="number"&&e>=0&&e!==1/0}function Hd(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zr(e,t){return typeof e=="function"?e(t):e}function $t(e,t){return typeof e=="function"?e(t):e}function tc(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(n){if(t.queryHash!==pl(o,t.options))return!1}else if(!Os(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function rc(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Ls(t.options.mutationKey)!==Ls(i))return!1}else if(!Os(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function pl(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ls)(e)}function Ls(e){return JSON.stringify(e,(t,r)=>Ca(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Os(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Os(e[r],t[r])):!1}var Sm=Object.prototype.hasOwnProperty;function ya(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=nc(e)&&nc(t);if(!n&&!(Ca(e)&&Ca(t)))return t;const i=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,c=n?new Array(a):{};let u=0;for(let d=0;d<a;d++){const f=n?d:o[d],m=e[f],p=t[f];if(m===p){c[f]=m,(n?d<i:Sm.call(e,f))&&u++;continue}if(m===null||p===null||typeof m!="object"||typeof p!="object"){c[f]=p;continue}const b=ya(m,p,r+1);c[f]=b,b===m&&u++}return i===a&&u===i?e:c}function ba(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function nc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ca(e){if(!sc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!sc(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function sc(e){return Object.prototype.toString.call(e)==="[object Object]"}function _m(e){return new Promise(t=>{Jr.setTimeout(t,e)})}function Sa(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return ya(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return ya(e,t)}return t}function wm(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function xm(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ui=Symbol();function Qd(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Ui&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ui?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Wd(e,t){return typeof e=="function"?e(...t):!!e}function Tm(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Ns=(()=>{let e=()=>bm;return{isServer(){return e()},setIsServer(t){e=t}}})();function _a(){let e,t;const r=new Promise((s,i)=>{e=s,t=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Em=ym;function Am(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=Em;const i=a=>{t?e.push(a):s(()=>{r(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(c=>{r(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||o()}return c},batchCalls:a=>(...c)=>{i(()=>{a(...c)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var yt=Am(),$n,Fr,Un,Fd,km=(Fd=class extends Ws{constructor(){super();ge(this,$n,!0);ge(this,Fr);ge(this,Un);X(this,Un,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){k(this,Fr)||this.setEventListener(k(this,Un))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,Fr))==null||t.call(this),X(this,Fr,void 0))}setEventListener(t){var r;X(this,Un,t),(r=k(this,Fr))==null||r.call(this),X(this,Fr,t(this.setOnline.bind(this)))}setOnline(t){k(this,$n)!==t&&(X(this,$n,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return k(this,$n)}},$n=new WeakMap,Fr=new WeakMap,Un=new WeakMap,Fd),zi=new km;function Im(e){return Math.min(1e3*2**e,3e4)}function Gd(e){return(e??"online")==="online"?zi.isOnline():!0}var wa=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Kd(e){let t=!1,r=0,n;const s=_a(),i=()=>s.status!=="pending",o=h=>{var v;if(!i()){const y=new wa(h);m(y),(v=e.onCancel)==null||v.call(e,y)}},a=()=>{t=!0},c=()=>{t=!1},u=()=>hl.isFocused()&&(e.networkMode==="always"||zi.isOnline())&&e.canRun(),d=()=>Gd(e.networkMode)&&e.canRun(),f=h=>{i()||(n==null||n(),s.resolve(h))},m=h=>{i()||(n==null||n(),s.reject(h))},p=()=>new Promise(h=>{var v;n=y=>{(i()||u())&&h(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var h;n=void 0,i()||(h=e.onContinue)==null||h.call(e)}),b=()=>{if(i())return;let h;const v=r===0?e.initialPromise:void 0;try{h=v??e.fn()}catch(y){h=Promise.reject(y)}Promise.resolve(h).then(f).catch(y=>{var E;if(i())return;const C=e.retry??(Ns.isServer()?0:3),S=e.retryDelay??Im,_=typeof S=="function"?S(r,y):S,x=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!x){m(y);return}r++,(E=e.onFail)==null||E.call(e,r,y),_m(_).then(()=>u()?void 0:p()).then(()=>{t?m(y):b()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(n==null||n(),s),cancelRetry:a,continueRetry:c,canStart:d,start:()=>(d()?b():p().then(b),s)}}var sn,Md,Yd=(Md=class{constructor(){ge(this,sn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),va(this.gcTime)&&X(this,sn,Jr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ns.isServer()?1/0:300*1e3))}clearGcTimeout(){k(this,sn)!==void 0&&(Jr.clearTimeout(k(this,sn)),X(this,sn,void 0))}},sn=new WeakMap,Md);function Dm(e){return{onFetch:(t,r)=>{var d,f,m,p,b;const n=t.options,s=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((b=t.state.data)==null?void 0:b.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const v=S=>{Tm(S,()=>t.signal,()=>h=!0)},y=Qd(t.options,t.fetchOptions),C=async(S,_,x)=>{if(h)return Promise.reject(t.signal.reason);if(_==null&&S.pages.length)return Promise.resolve(S);const D=(()=>{const O={client:t.client,queryKey:t.queryKey,pageParam:_,direction:x?"backward":"forward",meta:t.options.meta};return v(O),O})(),T=await y(D),{maxPages:j}=t.options,P=x?xm:wm;return{pages:P(S.pages,T,j),pageParams:P(S.pageParams,_,j)}};if(s&&i.length){const S=s==="backward",_=S?Lm:ic,x={pages:i,pageParams:o},E=_(n,x);a=await C(x,E,S)}else{const S=e??i.length;do{const _=c===0?o[0]??n.initialPageParam:ic(n,a);if(c>0&&_==null)break;a=await C(a,_),c++}while(c<S)}return a};t.options.persister?t.fetchFn=()=>{var h,v;return(v=(h=t.options).persister)==null?void 0:v.call(h,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function ic(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function Lm(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var zn,on,Vn,Yt,an,dt,Us,ln,qt,Zd,Sr,Bd,Om=(Bd=class extends Yd{constructor(t){super();ge(this,qt);ge(this,zn);ge(this,on);ge(this,Vn);ge(this,Yt);ge(this,an);ge(this,dt);ge(this,Us);ge(this,ln);X(this,ln,!1),X(this,Us,t.defaultOptions),this.setOptions(t.options),this.observers=[],X(this,an,t.client),X(this,Yt,k(this,an).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,X(this,on,ac(this.options)),this.state=t.state??k(this,on),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return k(this,zn)}get promise(){var t;return(t=k(this,dt))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,Us),...t},t!=null&&t._type&&X(this,zn,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ac(this.options);r.data!==void 0&&(this.setState(oc(r.data,r.dataUpdatedAt)),X(this,on,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Yt).remove(this)}setData(t,r){const n=Sa(this.state.data,t,this.options);return De(this,qt,Sr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){De(this,qt,Sr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=k(this,dt))==null?void 0:n.promise;return(s=k(this,dt))==null||s.cancel(t),r?r.then(Pt).catch(Pt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return k(this,on)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>$t(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ui||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Hd(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,dt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,dt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Yt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(k(this,dt)&&(k(this,ln)||De(this,qt,Zd).call(this)?k(this,dt).cancel({revert:!0}):k(this,dt).cancelRetry()),this.scheduleGc()),k(this,Yt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,qt,Sr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,m,p,b,h,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((u=k(this,dt))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(k(this,dt))return k(this,dt).continueRetry(),k(this,dt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(x=>x.options.queryFn);_&&this.setOptions(_.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(X(this,ln,!0),n.signal)})},i=()=>{const _=Qd(this.options,r),E=(()=>{const D={client:k(this,an),queryKey:this.queryKey,meta:this.meta};return s(D),D})();return X(this,ln,!1),this.options.persister?this.options.persister(_,E,this):_(E)},a=(()=>{const _={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:k(this,an),state:this.state,fetchFn:i};return s(_),_})(),c=k(this,zn)==="infinite"?Dm(this.options.pages):this.options.behavior;c==null||c.onFetch(a,this),X(this,Vn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&De(this,qt,Sr).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),X(this,dt,Kd({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,onCancel:_=>{_ instanceof wa&&_.revert&&this.setState({...k(this,Vn),fetchStatus:"idle"}),n.abort()},onFail:(_,x)=>{De(this,qt,Sr).call(this,{type:"failed",failureCount:_,error:x})},onPause:()=>{De(this,qt,Sr).call(this,{type:"pause"})},onContinue:()=>{De(this,qt,Sr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const _=await k(this,dt).start();if(_===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(_),(p=(m=k(this,Yt).config).onSuccess)==null||p.call(m,_,this),(h=(b=k(this,Yt).config).onSettled)==null||h.call(b,_,this.state.error,this),_}catch(_){if(_ instanceof wa){if(_.silent)return k(this,dt).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw De(this,qt,Sr).call(this,{type:"error",error:_}),(y=(v=k(this,Yt).config).onError)==null||y.call(v,_,this),(S=(C=k(this,Yt).config).onSettled)==null||S.call(C,this.state.data,_,this),_}finally{this.scheduleGc()}}},zn=new WeakMap,on=new WeakMap,Vn=new WeakMap,Yt=new WeakMap,an=new WeakMap,dt=new WeakMap,Us=new WeakMap,ln=new WeakMap,qt=new WeakSet,Zd=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Sr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Xd(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...oc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return X(this,Vn,t.manual?s:void 0),s;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),k(this,Yt).notify({query:this,type:"updated",action:t})})},Bd);function Xd(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Gd(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function oc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ac(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var jt,Le,zs,Dt,cn,Hn,_r,Mr,Vs,Qn,Wn,un,dn,Br,Gn,Be,ws,xa,Ta,Ea,Aa,ka,Ia,Da,Jd,qd,Nm=(qd=class extends Ws{constructor(t,r){super();ge(this,Be);ge(this,jt);ge(this,Le);ge(this,zs);ge(this,Dt);ge(this,cn);ge(this,Hn);ge(this,_r);ge(this,Mr);ge(this,Vs);ge(this,Qn);ge(this,Wn);ge(this,un);ge(this,dn);ge(this,Br);ge(this,Gn,new Set);this.options=r,X(this,jt,t),X(this,Mr,null),X(this,_r,_a()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,Le).addObserver(this),lc(k(this,Le),this.options)?De(this,Be,ws).call(this):this.updateResult(),De(this,Be,Aa).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return La(k(this,Le),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return La(k(this,Le),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,De(this,Be,ka).call(this),De(this,Be,Ia).call(this),k(this,Le).removeObserver(this)}setOptions(t){const r=this.options,n=k(this,Le);if(this.options=k(this,jt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $t(this.options.enabled,k(this,Le))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");De(this,Be,Da).call(this),k(this,Le).setOptions(this.options),r._defaulted&&!ba(this.options,r)&&k(this,jt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,Le),observer:this});const s=this.hasListeners();s&&cc(k(this,Le),n,this.options,r)&&De(this,Be,ws).call(this),this.updateResult(),s&&(k(this,Le)!==n||$t(this.options.enabled,k(this,Le))!==$t(r.enabled,k(this,Le))||zr(this.options.staleTime,k(this,Le))!==zr(r.staleTime,k(this,Le)))&&De(this,Be,xa).call(this);const i=De(this,Be,Ta).call(this);s&&(k(this,Le)!==n||$t(this.options.enabled,k(this,Le))!==$t(r.enabled,k(this,Le))||i!==k(this,Br))&&De(this,Be,Ea).call(this,i)}getOptimisticResult(t){const r=k(this,jt).getQueryCache().build(k(this,jt),t),n=this.createResult(r,t);return Pm(this,n)&&(X(this,Dt,n),X(this,Hn,this.options),X(this,cn,k(this,Le).state)),n}getCurrentResult(){return k(this,Dt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&k(this,_r).status==="pending"&&k(this,_r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){k(this,Gn).add(t)}getCurrentQuery(){return k(this,Le)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=k(this,jt).defaultQueryOptions(t),n=k(this,jt).getQueryCache().build(k(this,jt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return De(this,Be,ws).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Dt)))}createResult(t,r){var j;const n=k(this,Le),s=this.options,i=k(this,Dt),o=k(this,cn),a=k(this,Hn),u=t!==n?t.state:k(this,zs),{state:d}=t;let f={...d},m=!1,p;if(r._optimisticResults){const P=this.hasListeners(),O=!P&&lc(t,r),N=P&&cc(t,n,r,s);(O||N)&&(f={...f,...Xd(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:h,status:v}=f;p=f.data;let y=!1;if(r.placeholderData!==void 0&&p===void 0&&v==="pending"){let P;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(P=i.data,y=!0):P=typeof r.placeholderData=="function"?r.placeholderData((j=k(this,Wn))==null?void 0:j.state.data,k(this,Wn)):r.placeholderData,P!==void 0&&(v="success",p=Sa(i==null?void 0:i.data,P,r),m=!0)}if(r.select&&p!==void 0&&!y)if(i&&p===(o==null?void 0:o.data)&&r.select===k(this,Vs))p=k(this,Qn);else try{X(this,Vs,r.select),p=r.select(p),p=Sa(i==null?void 0:i.data,p,r),X(this,Qn,p),X(this,Mr,null)}catch(P){X(this,Mr,P)}k(this,Mr)&&(b=k(this,Mr),p=k(this,Qn),h=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",_=v==="error",x=S&&C,E=p!==void 0,T={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:_,isInitialLoading:x,isLoading:x,data:p,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:h,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:_&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:_&&E,isStale:ml(t,r),refetch:this.refetch,promise:k(this,_r),isEnabled:$t(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=T.data!==void 0,O=T.status==="error"&&!P,N=$=>{O?$.reject(T.error):P&&$.resolve(T.data)},R=()=>{const $=X(this,_r,T.promise=_a());N($)},M=k(this,_r);switch(M.status){case"pending":t.queryHash===n.queryHash&&N(M);break;case"fulfilled":(O||T.data!==M.value)&&R();break;case"rejected":(!O||T.error!==M.reason)&&R();break}}return T}updateResult(){const t=k(this,Dt),r=this.createResult(k(this,Le),this.options);if(X(this,cn,k(this,Le).state),X(this,Hn,this.options),k(this,cn).data!==void 0&&X(this,Wn,k(this,Le)),ba(r,t))return;X(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!k(this,Gn).size)return!0;const o=new Set(i??k(this,Gn));return this.options.throwOnError&&o.add("error"),Object.keys(k(this,Dt)).some(a=>{const c=a;return k(this,Dt)[c]!==t[c]&&o.has(c)})};De(this,Be,Jd).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&De(this,Be,Aa).call(this)}},jt=new WeakMap,Le=new WeakMap,zs=new WeakMap,Dt=new WeakMap,cn=new WeakMap,Hn=new WeakMap,_r=new WeakMap,Mr=new WeakMap,Vs=new WeakMap,Qn=new WeakMap,Wn=new WeakMap,un=new WeakMap,dn=new WeakMap,Br=new WeakMap,Gn=new WeakMap,Be=new WeakSet,ws=function(t){De(this,Be,Da).call(this);let r=k(this,Le).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Pt)),r},xa=function(){De(this,Be,ka).call(this);const t=zr(this.options.staleTime,k(this,Le));if(Ns.isServer()||k(this,Dt).isStale||!va(t))return;const n=Hd(k(this,Dt).dataUpdatedAt,t)+1;X(this,un,Jr.setTimeout(()=>{k(this,Dt).isStale||this.updateResult()},n))},Ta=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,Le)):this.options.refetchInterval)??!1},Ea=function(t){De(this,Be,Ia).call(this),X(this,Br,t),!(Ns.isServer()||$t(this.options.enabled,k(this,Le))===!1||!va(k(this,Br))||k(this,Br)===0)&&X(this,dn,Jr.setInterval(()=>{(this.options.refetchIntervalInBackground||hl.isFocused())&&De(this,Be,ws).call(this)},k(this,Br)))},Aa=function(){De(this,Be,xa).call(this),De(this,Be,Ea).call(this,De(this,Be,Ta).call(this))},ka=function(){k(this,un)!==void 0&&(Jr.clearTimeout(k(this,un)),X(this,un,void 0))},Ia=function(){k(this,dn)!==void 0&&(Jr.clearInterval(k(this,dn)),X(this,dn,void 0))},Da=function(){const t=k(this,jt).getQueryCache().build(k(this,jt),this.options);if(t===k(this,Le))return;const r=k(this,Le);X(this,Le,t),X(this,zs,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Jd=function(t){yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(k(this,Dt))}),k(this,jt).getQueryCache().notify({query:k(this,Le),type:"observerResultsUpdated"})})},qd);function jm(e,t){return $t(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&$t(t.retryOnMount,e)===!1)}function lc(e,t){return jm(e,t)||e.state.data!==void 0&&La(e,t,t.refetchOnMount)}function La(e,t,r){if($t(t.enabled,e)!==!1&&zr(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ml(e,t)}return!1}function cc(e,t,r,n){return(e!==t||$t(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ml(e,r)}function ml(e,t){return $t(t.enabled,e)!==!1&&e.isStaleByTime(zr(t.staleTime,e))}function Pm(e,t){return!ba(e.getCurrentResult(),t)}var Hs,pr,Tt,fn,mr,Lr,$d,Rm=($d=class extends Yd{constructor(t){super();ge(this,mr);ge(this,Hs);ge(this,pr);ge(this,Tt);ge(this,fn);X(this,Hs,t.client),this.mutationId=t.mutationId,X(this,Tt,t.mutationCache),X(this,pr,[]),this.state=t.state||Fm(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,pr).includes(t)||(k(this,pr).push(t),this.clearGcTimeout(),k(this,Tt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){X(this,pr,k(this,pr).filter(r=>r!==t)),this.scheduleGc(),k(this,Tt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,pr).length||(this.state.status==="pending"?this.scheduleGc():k(this,Tt).remove(this))}continue(){var t;return((t=k(this,fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,c,u,d,f,m,p,b,h,v,y,C,S,_,x,E,D;const r=()=>{De(this,mr,Lr).call(this,{type:"continue"})},n={client:k(this,Hs),meta:this.options.meta,mutationKey:this.options.mutationKey};X(this,fn,Kd({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(T,j)=>{De(this,mr,Lr).call(this,{type:"failed",failureCount:T,error:j})},onPause:()=>{De(this,mr,Lr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,Tt).canRun(this)}));const s=this.state.status==="pending",i=!k(this,fn).canStart();try{if(s)r();else{De(this,mr,Lr).call(this,{type:"pending",variables:t,isPaused:i}),k(this,Tt).config.onMutate&&await k(this,Tt).config.onMutate(t,this,n);const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,n));j!==this.state.context&&De(this,mr,Lr).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const T=await k(this,fn).start();return await((u=(c=k(this,Tt).config).onSuccess)==null?void 0:u.call(c,T,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,T,t,this.state.context,n)),await((p=(m=k(this,Tt).config).onSettled)==null?void 0:p.call(m,T,null,this.state.variables,this.state.context,this,n)),await((h=(b=this.options).onSettled)==null?void 0:h.call(b,T,null,t,this.state.context,n)),De(this,mr,Lr).call(this,{type:"success",data:T}),T}catch(T){try{await((y=(v=k(this,Tt).config).onError)==null?void 0:y.call(v,T,t,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,T,t,this.state.context,n))}catch(j){Promise.reject(j)}try{await((x=(_=k(this,Tt).config).onSettled)==null?void 0:x.call(_,void 0,T,this.state.variables,this.state.context,this,n))}catch(j){Promise.reject(j)}try{await((D=(E=this.options).onSettled)==null?void 0:D.call(E,void 0,T,t,this.state.context,n))}catch(j){Promise.reject(j)}throw De(this,mr,Lr).call(this,{type:"error",error:T}),T}finally{k(this,Tt).runNext(this)}}},Hs=new WeakMap,pr=new WeakMap,Tt=new WeakMap,fn=new WeakMap,mr=new WeakSet,Lr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),yt.batch(()=>{k(this,pr).forEach(n=>{n.onMutationUpdate(t)}),k(this,Tt).notify({mutation:this,type:"updated",action:t})})},$d);function Fm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,nr,Qs,Ud,Mm=(Ud=class extends Ws{constructor(t={}){super();ge(this,wr);ge(this,nr);ge(this,Qs);this.config=t,X(this,wr,new Set),X(this,nr,new Map),X(this,Qs,0)}build(t,r,n){const s=new Rm({client:t,mutationCache:this,mutationId:++di(this,Qs)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){k(this,wr).add(t);const r=fi(t);if(typeof r=="string"){const n=k(this,nr).get(r);n?n.push(t):k(this,nr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,wr).delete(t)){const r=fi(t);if(typeof r=="string"){const n=k(this,nr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&k(this,nr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=fi(t);if(typeof r=="string"){const n=k(this,nr).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=fi(t);if(typeof r=="string"){const s=(n=k(this,nr).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yt.batch(()=>{k(this,wr).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,wr).clear(),k(this,nr).clear()})}getAll(){return Array.from(k(this,wr))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>rc(r,n))}findAll(t={}){return this.getAll().filter(r=>rc(t,r))}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Pt))))}},wr=new WeakMap,nr=new WeakMap,Qs=new WeakMap,Ud);function fi(e){var t;return(t=e.options.scope)==null?void 0:t.id}var gr,zd,Bm=(zd=class extends Ws{constructor(t={}){super();ge(this,gr);this.config=t,X(this,gr,new Map)}build(t,r,n){const s=r.queryKey,i=r.queryHash??pl(s,r);let o=this.get(i);return o||(o=new Om({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){k(this,gr).has(t.queryHash)||(k(this,gr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=k(this,gr).get(t.queryHash);r&&(t.destroy(),r===t&&k(this,gr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,gr).get(t)}getAll(){return[...k(this,gr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>tc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>tc(t,n)):r}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},gr=new WeakMap,zd),Je,qr,$r,Kn,Yn,Ur,Zn,Xn,Vd,qm=(Vd=class{constructor(e={}){ge(this,Je);ge(this,qr);ge(this,$r);ge(this,Kn);ge(this,Yn);ge(this,Ur);ge(this,Zn);ge(this,Xn);X(this,Je,e.queryCache||new Bm),X(this,qr,e.mutationCache||new Mm),X(this,$r,e.defaultOptions||{}),X(this,Kn,new Map),X(this,Yn,new Map),X(this,Ur,0)}mount(){di(this,Ur)._++,k(this,Ur)===1&&(X(this,Zn,hl.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Je).onFocus())})),X(this,Xn,zi.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Je).onOnline())})))}unmount(){var e,t;di(this,Ur)._--,k(this,Ur)===0&&((e=k(this,Zn))==null||e.call(this),X(this,Zn,void 0),(t=k(this,Xn))==null||t.call(this),X(this,Xn,void 0))}isFetching(e){return k(this,Je).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,qr).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Je).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=k(this,Je).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zr(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return k(this,Je).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=k(this,Je).get(n.queryHash),i=s==null?void 0:s.state.data,o=Cm(t,i);if(o!==void 0)return k(this,Je).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return yt.batch(()=>k(this,Je).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Je).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=k(this,Je);yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=k(this,Je);return yt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=yt.batch(()=>k(this,Je).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Pt).catch(Pt)}invalidateQueries(e,t={}){return yt.batch(()=>(k(this,Je).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=yt.batch(()=>k(this,Je).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Pt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Pt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=k(this,Je).build(this,t);return r.isStaleByTime(zr(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Pt).catch(Pt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Pt).catch(Pt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return zi.isOnline()?k(this,qr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Je)}getMutationCache(){return k(this,qr)}getDefaultOptions(){return k(this,$r)}setDefaultOptions(e){X(this,$r,e)}setQueryDefaults(e,t){k(this,Kn).set(Ls(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,Kn).values()],r={};return t.forEach(n=>{Os(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){k(this,Yn).set(Ls(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,Yn).values()],r={};return t.forEach(n=>{Os(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,$r).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pl(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ui&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,$r).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Je).clear(),k(this,qr).clear()}},Je=new WeakMap,qr=new WeakMap,$r=new WeakMap,Kn=new WeakMap,Yn=new WeakMap,Ur=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,Vd),ef=Me.createContext(void 0),$m=e=>{const t=Me.useContext(ef);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Um=({client:e,children:t})=>(Me.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(ef.Provider,{value:e,children:t})),tf=Me.createContext(!1),zm=()=>Me.useContext(tf);tf.Provider;function Vm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hm=Me.createContext(Vm()),Qm=()=>Me.useContext(Hm),Wm=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Wd(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Gm=e=>{Me.useEffect(()=>{e.clearReset()},[e])},Km=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||Wd(r,[e.error,n])),Ym=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Zm=(e,t)=>e.isLoading&&e.isFetching&&!t,Xm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,uc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function Jm(e,t,r){var p,b,h,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=zm(),s=Qm(),i=$m(),o=i.defaultQueryOptions(e);(b=(p=i.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||b.call(p,o);const a=i.getQueryCache().get(o.queryHash);process.env.NODE_ENV!=="production"&&(o.queryFn||console.error(`[${o.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;o._optimisticResults=n?"isRestoring":c?"optimistic":void 0,Ym(o),Wm(o,s,a),Gm(s);const u=!i.getQueryCache().get(o.queryHash),[d]=Me.useState(()=>new t(i,o)),f=d.getOptimisticResult(o),m=!n&&c;if(Me.useSyncExternalStore(Me.useCallback(y=>{const C=m?d.subscribe(yt.batchCalls(y)):Pt;return d.updateResult(),C},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Me.useEffect(()=>{d.setOptions(o)},[o,d]),Xm(o,f))throw uc(o,d,s);if(Km({result:f,errorResetBoundary:s,throwOnError:o.throwOnError,query:a,suspense:o.suspense}))throw f.error;if((v=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,o,f),o.experimental_prefetchInRender&&!Ns.isServer()&&Zm(f,n)){const y=u?uc(o,d,s):a==null?void 0:a.promise;y==null||y.catch(Pt).finally(()=>{d.updateResult()})}return o.notifyOnChangeProps?f:d.trackResult(f)}function Jn(e,t){return Jm(e,Nm)}let eg={data:""},tg=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||eg},rg=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ng=/\/\*[^]*?\*\/| +/g,dc=/\n+/g,Pr=(e,t)=>{let r="",n="",s="";for(let i in e){let o=e[i];i[0]=="@"?i[1]=="i"?r=i+" "+o+";":n+=i[1]=="f"?Pr(o,i):i+"{"+Pr(o,i[1]=="k"?"":t)+"}":typeof o=="object"?n+=Pr(o,t?t.replace(/([^,])+/g,a=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):i):o!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Pr.p?Pr.p(i,o):i+":"+o+";")}return r+(t&&s?t+"{"+s+"}":s)+n},kr={},rf=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+rf(e[r]);return t}return e},sg=(e,t,r,n,s)=>{let i=rf(e),o=kr[i]||(kr[i]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(i));if(!kr[o]){let c=i!==e?e:(u=>{let d,f,m=[{}];for(;d=rg.exec(u.replace(ng,""));)d[4]?m.shift():d[3]?(f=d[3].replace(dc," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][d[1]]=d[2].replace(dc," ").trim();return m[0]})(e);kr[o]=Pr(s?{["@keyframes "+o]:c}:c,r?"":"."+o)}let a=r&&kr.g;return r&&(kr.g=kr[o]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(kr[o],t,n,a),o},ig=(e,t,r)=>e.reduce((n,s,i)=>{let o=t[i];if(o&&o.call){let a=o(r),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=c?"."+c:a&&typeof a=="object"?a.props?"":Pr(a,""):a===!1?"":a}return n+s+(o??"")},"");function ao(e){let t=this||{},r=e.call?e(t.p):e;return sg(r.unshift?r.raw?ig(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,tg(t.target),t.g,t.o,t.k)}let nf,Oa,Na;ao.bind({g:1});let Tr=ao.bind({k:1});function og(e,t,r,n){Pr.p=t,nf=e,Oa=r,Na=n}function Hr(e,t){let r=this||{};return function(){let n=arguments;function s(i,o){let a=Object.assign({},i),c=a.className||s.className;r.p=Object.assign({theme:Oa&&Oa()},a),r.o=/go\d/.test(c),a.className=ao.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=a.as||e,delete a.as),Na&&u[0]&&Na(a),nf(u,a)}return s}}var ag=e=>typeof e=="function",Vi=(e,t)=>ag(e)?e(t):e,lg=(()=>{let e=0;return()=>(++e).toString()})(),sf=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),cg=20,gl="default",of=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return of(e,{type:e.toasts.find(o=>o.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(o=>o.id===s||s===void 0?{...o,dismissed:!0,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},Ei=[],af={toasts:[],pausedAt:void 0,settings:{toastLimit:cg}},vr={},lf=(e,t=gl)=>{vr[t]=of(vr[t]||af,e),Ei.forEach(([r,n])=>{r===t&&n(vr[t])})},cf=e=>Object.keys(vr).forEach(t=>lf(e,t)),ug=e=>Object.keys(vr).find(t=>vr[t].toasts.some(r=>r.id===e)),lo=(e=gl)=>t=>{lf(t,e)},dg={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},fg=(e={},t=gl)=>{let[r,n]=g.useState(vr[t]||af),s=g.useRef(vr[t]);g.useEffect(()=>(s.current!==vr[t]&&n(vr[t]),Ei.push([t,n]),()=>{let o=Ei.findIndex(([a])=>a===t);o>-1&&Ei.splice(o,1)}),[t]);let i=r.toasts.map(o=>{var a,c,u;return{...e,...e[o.type],...o,removeDelay:o.removeDelay||((a=e[o.type])==null?void 0:a.removeDelay)||(e==null?void 0:e.removeDelay),duration:o.duration||((c=e[o.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||dg[o.type],style:{...e.style,...(u=e[o.type])==null?void 0:u.style,...o.style}}});return{...r,toasts:i}},hg=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||lg()}),Gs=e=>(t,r)=>{let n=hg(t,e,r);return lo(n.toasterId||ug(n.id))({type:2,toast:n}),n.id},at=(e,t)=>Gs("blank")(e,t);at.error=Gs("error");at.success=Gs("success");at.loading=Gs("loading");at.custom=Gs("custom");at.dismiss=(e,t)=>{let r={type:3,toastId:e};t?lo(t)(r):cf(r)};at.dismissAll=e=>at.dismiss(void 0,e);at.remove=(e,t)=>{let r={type:4,toastId:e};t?lo(t)(r):cf(r)};at.removeAll=e=>at.remove(void 0,e);at.promise=(e,t,r)=>{let n=at.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?Vi(t.success,s):void 0;return i?at.success(i,{id:n,...r,...r==null?void 0:r.success}):at.dismiss(n),s}).catch(s=>{let i=t.error?Vi(t.error,s):void 0;i?at.error(i,{id:n,...r,...r==null?void 0:r.error}):at.dismiss(n)}),e};var pg=1e3,mg=(e,t="default")=>{let{toasts:r,pausedAt:n}=fg(e,t),s=g.useRef(new Map).current,i=g.useCallback((f,m=pg)=>{if(s.has(f))return;let p=setTimeout(()=>{s.delete(f),o({type:4,toastId:f})},m);s.set(f,p)},[]);g.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(p=>{if(p.duration===1/0)return;let b=(p.duration||0)+p.pauseDuration-(f-p.createdAt);if(b<0){p.visible&&at.dismiss(p.id);return}return setTimeout(()=>at.dismiss(p.id,t),b)});return()=>{m.forEach(p=>p&&clearTimeout(p))}},[r,n,t]);let o=g.useCallback(lo(t),[t]),a=g.useCallback(()=>{o({type:5,time:Date.now()})},[o]),c=g.useCallback((f,m)=>{o({type:1,toast:{id:f,height:m}})},[o]),u=g.useCallback(()=>{n&&o({type:6,time:Date.now()})},[n,o]),d=g.useCallback((f,m)=>{let{reverseOrder:p=!1,gutter:b=8,defaultPosition:h}=m||{},v=r.filter(S=>(S.position||h)===(f.position||h)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,_)=>_<y&&S.visible).length;return v.filter(S=>S.visible).slice(...p?[C+1]:[0,C]).reduce((S,_)=>S+(_.height||0)+b,0)},[r]);return g.useEffect(()=>{r.forEach(f=>{if(f.dismissed)i(f.id,f.removeDelay);else{let m=s.get(f.id);m&&(clearTimeout(m),s.delete(f.id))}})},[r,i]),{toasts:r,handlers:{updateHeight:c,startPause:a,endPause:u,calculateOffset:d}}},gg=Tr`
1
+ "use strict";var Sg=Object.defineProperty;var Fc=e=>{throw TypeError(e)};var xg=(e,t,r)=>t in e?Sg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ns=(e,t,r)=>xg(e,typeof t!="symbol"?t+"":t,r),li=(e,t,r)=>t.has(e)||Fc("Cannot "+r);var A=(e,t,r)=>(li(e,t,"read from private field"),r?r.call(e):t.get(e)),_e=(e,t,r)=>t.has(e)?Fc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),se=(e,t,r,n)=>(li(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Me=(e,t,r)=>(li(e,t,"access private method"),r);var jo=(e,t,r,n)=>({set _(s){se(e,t,s,r)},get _(){return A(e,t,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),Hr=require("react-dom"),l=require("react/jsx-runtime");function _g(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const Qe=_g(g);var mo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},An,un,os,Of,wg=(Of=class extends mo{constructor(){super();_e(this,An);_e(this,un);_e(this,os);se(this,os,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,un)||this.setEventListener(A(this,os))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,un))==null||t.call(this),se(this,un,void 0))}setEventListener(t){var r;se(this,os,t),(r=A(this,un))==null||r.call(this),se(this,un,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){A(this,An)!==t&&(se(this,An,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof A(this,An)=="boolean"?A(this,An):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},An=new WeakMap,un=new WeakMap,os=new WeakMap,Of),$l=new wg,Tg={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},jr,Ln,Nf,Eg=(Nf=class{constructor(){_e(this,jr,Tg);_e(this,Ln,!1)}setTimeoutProvider(e){process.env.NODE_ENV!=="production"&&A(this,Ln)&&e!==A(this,jr)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:A(this,jr),provider:e}),se(this,jr,e),process.env.NODE_ENV!=="production"&&se(this,Ln,!1)}setTimeout(e,t){return process.env.NODE_ENV!=="production"&&se(this,Ln,!0),A(this,jr).setTimeout(e,t)}clearTimeout(e){A(this,jr).clearTimeout(e)}setInterval(e,t){return process.env.NODE_ENV!=="production"&&se(this,Ln,!0),A(this,jr).setInterval(e,t)}clearInterval(e){A(this,jr).clearInterval(e)}},jr=new WeakMap,Ln=new WeakMap,Nf),Tn=new Eg;function kg(e){setTimeout(e,0)}var Ag=typeof window>"u"||"Deno"in globalThis;function Yt(){}function Lg(e,t){return typeof e=="function"?e(t):e}function Vi(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vn(e,t){return typeof e=="function"?e(t):e}function sr(e,t){return typeof e=="function"?e(t):e}function Mc(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:a,stale:i}=e;if(a){if(n){if(t.queryHash!==Ul(a,t.options))return!1}else if(!Xs(t.queryKey,a))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||s&&s!==t.state.fetchStatus||o&&!o(t))}function Bc(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Zs(t.options.mutationKey)!==Zs(o))return!1}else if(!Xs(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Ul(e,t){return((t==null?void 0:t.queryKeyHashFn)||Zs)(e)}function Zs(e){return JSON.stringify(e,(t,r)=>Qi(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function Xs(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Xs(e[r],t[r])):!1}var Ig=Object.prototype.hasOwnProperty;function Hi(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=qc(e)&&qc(t);if(!n&&!(Qi(e)&&Qi(t)))return t;const o=(n?e:Object.keys(e)).length,a=n?t:Object.keys(t),i=a.length,c=n?new Array(i):{};let u=0;for(let d=0;d<i;d++){const f=n?d:a[d],m=e[f],h=t[f];if(m===h){c[f]=m,(n?d<o:Ig.call(e,f))&&u++;continue}if(m===null||h===null||typeof m!="object"||typeof h!="object"){c[f]=h;continue}const b=Hi(m,h,r+1);c[f]=b,b===m&&u++}return o===i&&u===o?e:c}function zi(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function qc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qi(e){if(!$c(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!$c(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function $c(e){return Object.prototype.toString.call(e)==="[object Object]"}function Dg(e){return new Promise(t=>{Tn.setTimeout(t,e)})}function Wi(e,t,r){if(typeof r.structuralSharing=="function")return r.structuralSharing(e,t);if(r.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Hi(e,t)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${r.queryHash}]: ${n}`),n}return Hi(e,t)}return t}function jg(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Og(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var ua=Symbol();function Hf(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===ua&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ua?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function zf(e,t){return typeof e=="function"?e(...t):!!e}function Ng(e,t,r){let n=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),n||(n=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e}var Js=(()=>{let e=()=>Ag;return{isServer(){return e()},setIsServer(t){e=t}}})();function Gi(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}var Rg=kg;function Pg(){let e=[],t=0,r=i=>{i()},n=i=>{i()},s=Rg;const o=i=>{t?e.push(i):s(()=>{r(i)})},a=()=>{const i=e;e=[],i.length&&s(()=>{n(()=>{i.forEach(c=>{r(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{r=i},setBatchNotifyFunction:i=>{n=i},setScheduler:i=>{s=i}}}var kt=Pg(),as,dn,is,Rf,Fg=(Rf=class extends mo{constructor(){super();_e(this,as,!0);_e(this,dn);_e(this,is);se(this,is,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){A(this,dn)||this.setEventListener(A(this,is))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,dn))==null||t.call(this),se(this,dn,void 0))}setEventListener(t){var r;se(this,is,t),(r=A(this,dn))==null||r.call(this),se(this,dn,t(this.setOnline.bind(this)))}setOnline(t){A(this,as)!==t&&(se(this,as,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return A(this,as)}},as=new WeakMap,dn=new WeakMap,is=new WeakMap,Rf),da=new Fg;function Mg(e){return Math.min(1e3*2**e,3e4)}function Qf(e){return(e??"online")==="online"?da.isOnline():!0}var Ki=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Wf(e){let t=!1,r=0,n;const s=Gi(),o=()=>s.status!=="pending",a=p=>{var v;if(!o()){const y=new Ki(p);m(y),(v=e.onCancel)==null||v.call(e,y)}},i=()=>{t=!0},c=()=>{t=!1},u=()=>$l.isFocused()&&(e.networkMode==="always"||da.isOnline())&&e.canRun(),d=()=>Qf(e.networkMode)&&e.canRun(),f=p=>{o()||(n==null||n(),s.resolve(p))},m=p=>{o()||(n==null||n(),s.reject(p))},h=()=>new Promise(p=>{var v;n=y=>{(o()||u())&&p(y)},(v=e.onPause)==null||v.call(e)}).then(()=>{var p;n=void 0,o()||(p=e.onContinue)==null||p.call(e)}),b=()=>{if(o())return;let p;const v=r===0?e.initialPromise:void 0;try{p=v??e.fn()}catch(y){p=Promise.reject(y)}Promise.resolve(p).then(f).catch(y=>{var w;if(o())return;const C=e.retry??(Js.isServer()?0:3),S=e.retryDelay??Mg,x=typeof S=="function"?S(r,y):S,_=C===!0||typeof C=="number"&&r<C||typeof C=="function"&&C(r,y);if(t||!_){m(y);return}r++,(w=e.onFail)==null||w.call(e,r,y),Dg(x).then(()=>u()?void 0:h()).then(()=>{t?m(y):b()})})};return{promise:s,status:()=>s.status,cancel:a,continue:()=>(n==null||n(),s),cancelRetry:i,continueRetry:c,canStart:d,start:()=>(d()?b():h().then(b),s)}}var In,Pf,Gf=(Pf=class{constructor(){_e(this,In)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vi(this.gcTime)&&se(this,In,Tn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Js.isServer()?1/0:300*1e3))}clearGcTimeout(){A(this,In)!==void 0&&(Tn.clearTimeout(A(this,In)),se(this,In,void 0))}},In=new WeakMap,Pf);function Bg(e){return{onFetch:(t,r)=>{var d,f,m,h,b;const n=t.options,s=(m=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],a=((b=t.state.data)==null?void 0:b.pageParams)||[];let i={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const v=S=>{Ng(S,()=>t.signal,()=>p=!0)},y=Hf(t.options,t.fetchOptions),C=async(S,x,_)=>{if(p)return Promise.reject(t.signal.reason);if(x==null&&S.pages.length)return Promise.resolve(S);const E=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:x,direction:_?"backward":"forward",meta:t.options.meta};return v(I),I})(),k=await y(E),{maxPages:N}=t.options,F=_?Og:jg;return{pages:F(S.pages,k,N),pageParams:F(S.pageParams,x,N)}};if(s&&o.length){const S=s==="backward",x=S?qg:Uc,_={pages:o,pageParams:a},w=x(n,_);i=await C(_,w,S)}else{const S=e??o.length;do{const x=c===0?a[0]??n.initialPageParam:Uc(n,i);if(c>0&&x==null)break;i=await C(i,x),c++}while(c<S)}return i};t.options.persister?t.fetchFn=()=>{var p,v;return(v=(p=t.options).persister)==null?void 0:v.call(p,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Uc(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function qg(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ls,Dn,cs,pr,jn,Ct,co,On,nr,Kf,qr,Ff,$g=(Ff=class extends Gf{constructor(t){super();_e(this,nr);_e(this,ls);_e(this,Dn);_e(this,cs);_e(this,pr);_e(this,jn);_e(this,Ct);_e(this,co);_e(this,On);se(this,On,!1),se(this,co,t.defaultOptions),this.setOptions(t.options),this.observers=[],se(this,jn,t.client),se(this,pr,A(this,jn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,se(this,Dn,Hc(this.options)),this.state=t.state??A(this,Dn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return A(this,ls)}get promise(){var t;return(t=A(this,Ct))==null?void 0:t.promise}setOptions(t){if(this.options={...A(this,co),...t},t!=null&&t._type&&se(this,ls,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Hc(this.options);r.data!==void 0&&(this.setState(Vc(r.data,r.dataUpdatedAt)),se(this,Dn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,pr).remove(this)}setData(t,r){const n=Wi(this.state.data,t,this.options);return Me(this,nr,qr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Me(this,nr,qr).call(this,{type:"setState",state:t})}cancel(t){var n,s;const r=(n=A(this,Ct))==null?void 0:n.promise;return(s=A(this,Ct))==null||s.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return A(this,Dn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>sr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ua||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Vf(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,Ct))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,Ct))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,pr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(A(this,Ct)&&(A(this,On)||Me(this,nr,Kf).call(this)?A(this,Ct).cancel({revert:!0}):A(this,Ct).cancelRetry()),this.scheduleGc()),A(this,pr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Me(this,nr,qr).call(this,{type:"invalidate"})}async fetch(t,r){var u,d,f,m,h,b,p,v,y,C,S;if(this.state.fetchStatus!=="idle"&&((u=A(this,Ct))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,Ct))return A(this,Ct).continueRetry(),A(this,Ct).promise}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(_=>_.options.queryFn);x&&this.setOptions(x.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,s=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(se(this,On,!0),n.signal)})},o=()=>{const x=Hf(this.options,r),w=(()=>{const E={client:A(this,jn),queryKey:this.queryKey,meta:this.meta};return s(E),E})();return se(this,On,!1),this.options.persister?this.options.persister(x,w,this):x(w)},i=(()=>{const x={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,jn),state:this.state,fetchFn:o};return s(x),x})(),c=A(this,ls)==="infinite"?Bg(this.options.pages):this.options.behavior;c==null||c.onFetch(i,this),se(this,cs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=i.fetchOptions)==null?void 0:d.meta))&&Me(this,nr,qr).call(this,{type:"fetch",meta:(f=i.fetchOptions)==null?void 0:f.meta}),se(this,Ct,Wf({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,onCancel:x=>{x instanceof Ki&&x.revert&&this.setState({...A(this,cs),fetchStatus:"idle"}),n.abort()},onFail:(x,_)=>{Me(this,nr,qr).call(this,{type:"failed",failureCount:x,error:_})},onPause:()=>{Me(this,nr,qr).call(this,{type:"pause"})},onContinue:()=>{Me(this,nr,qr).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}));try{const x=await A(this,Ct).start();if(x===void 0)throw process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(x),(h=(m=A(this,pr).config).onSuccess)==null||h.call(m,x,this),(p=(b=A(this,pr).config).onSettled)==null||p.call(b,x,this.state.error,this),x}catch(x){if(x instanceof Ki){if(x.silent)return A(this,Ct).promise;if(x.revert){if(this.state.data===void 0)throw x;return this.state.data}}throw Me(this,nr,qr).call(this,{type:"error",error:x}),(y=(v=A(this,pr).config).onError)==null||y.call(v,x,this),(S=(C=A(this,pr).config).onSettled)==null||S.call(C,this.state.data,x,this),x}finally{this.scheduleGc()}}},ls=new WeakMap,Dn=new WeakMap,cs=new WeakMap,pr=new WeakMap,jn=new WeakMap,Ct=new WeakMap,co=new WeakMap,On=new WeakMap,nr=new WeakSet,Kf=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},qr=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Yf(n.data,this.options),fetchMeta:t.meta??null};case"success":const s={...n,...Vc(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return se(this,cs,t.manual?s:void 0),s;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),kt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),A(this,pr).notify({query:this,type:"updated",action:t})})},Ff);function Yf(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Qf(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Vc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Hc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Kt,qe,uo,Vt,Nn,us,$r,fn,fo,ds,fs,Rn,Pn,hn,hs,We,Vs,Yi,Zi,Xi,Ji,el,tl,rl,Zf,Mf,Ug=(Mf=class extends mo{constructor(t,r){super();_e(this,We);_e(this,Kt);_e(this,qe);_e(this,uo);_e(this,Vt);_e(this,Nn);_e(this,us);_e(this,$r);_e(this,fn);_e(this,fo);_e(this,ds);_e(this,fs);_e(this,Rn);_e(this,Pn);_e(this,hn);_e(this,hs,new Set);this.options=r,se(this,Kt,t),se(this,fn,null),se(this,$r,Gi()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(A(this,qe).addObserver(this),zc(A(this,qe),this.options)?Me(this,We,Vs).call(this):this.updateResult(),Me(this,We,Ji).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return nl(A(this,qe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return nl(A(this,qe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,We,el).call(this),Me(this,We,tl).call(this),A(this,qe).removeObserver(this)}setOptions(t){const r=this.options,n=A(this,qe);if(this.options=A(this,Kt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof sr(this.options.enabled,A(this,qe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Me(this,We,rl).call(this),A(this,qe).setOptions(this.options),r._defaulted&&!zi(this.options,r)&&A(this,Kt).getQueryCache().notify({type:"observerOptionsUpdated",query:A(this,qe),observer:this});const s=this.hasListeners();s&&Qc(A(this,qe),n,this.options,r)&&Me(this,We,Vs).call(this),this.updateResult(),s&&(A(this,qe)!==n||sr(this.options.enabled,A(this,qe))!==sr(r.enabled,A(this,qe))||vn(this.options.staleTime,A(this,qe))!==vn(r.staleTime,A(this,qe)))&&Me(this,We,Yi).call(this);const o=Me(this,We,Zi).call(this);s&&(A(this,qe)!==n||sr(this.options.enabled,A(this,qe))!==sr(r.enabled,A(this,qe))||o!==A(this,hn))&&Me(this,We,Xi).call(this,o)}getOptimisticResult(t){const r=A(this,Kt).getQueryCache().build(A(this,Kt),t),n=this.createResult(r,t);return Hg(this,n)&&(se(this,Vt,n),se(this,us,this.options),se(this,Nn,A(this,qe).state)),n}getCurrentResult(){return A(this,Vt)}trackResult(t,r){return new Proxy(t,{get:(n,s)=>(this.trackProp(s),r==null||r(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&A(this,$r).status==="pending"&&A(this,$r).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(t){A(this,hs).add(t)}getCurrentQuery(){return A(this,qe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=A(this,Kt).defaultQueryOptions(t),n=A(this,Kt).getQueryCache().build(A(this,Kt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Me(this,We,Vs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),A(this,Vt)))}createResult(t,r){var N;const n=A(this,qe),s=this.options,o=A(this,Vt),a=A(this,Nn),i=A(this,us),u=t!==n?t.state:A(this,uo),{state:d}=t;let f={...d},m=!1,h;if(r._optimisticResults){const F=this.hasListeners(),I=!F&&zc(t,r),R=F&&Qc(t,n,r,s);(I||R)&&(f={...f,...Yf(d.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:b,errorUpdatedAt:p,status:v}=f;h=f.data;let y=!1;if(r.placeholderData!==void 0&&h===void 0&&v==="pending"){let F;o!=null&&o.isPlaceholderData&&r.placeholderData===(i==null?void 0:i.placeholderData)?(F=o.data,y=!0):F=typeof r.placeholderData=="function"?r.placeholderData((N=A(this,fs))==null?void 0:N.state.data,A(this,fs)):r.placeholderData,F!==void 0&&(v="success",h=Wi(o==null?void 0:o.data,F,r),m=!0)}if(r.select&&h!==void 0&&!y)if(o&&h===(a==null?void 0:a.data)&&r.select===A(this,fo))h=A(this,ds);else try{se(this,fo,r.select),h=r.select(h),h=Wi(o==null?void 0:o.data,h,r),se(this,ds,h),se(this,fn,null)}catch(F){se(this,fn,F)}A(this,fn)&&(b=A(this,fn),h=A(this,ds),p=Date.now(),v="error");const C=f.fetchStatus==="fetching",S=v==="pending",x=v==="error",_=S&&C,w=h!==void 0,k={status:v,fetchStatus:f.fetchStatus,isPending:S,isSuccess:v==="success",isError:x,isInitialLoading:_,isLoading:_,data:h,dataUpdatedAt:f.dataUpdatedAt,error:b,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:x&&!w,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:x&&w,isStale:Vl(t,r),refetch:this.refetch,promise:A(this,$r),isEnabled:sr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=k.data!==void 0,I=k.status==="error"&&!F,R=V=>{I?V.reject(k.error):F&&V.resolve(k.data)},P=()=>{const V=se(this,$r,k.promise=Gi());R(V)},O=A(this,$r);switch(O.status){case"pending":t.queryHash===n.queryHash&&R(O);break;case"fulfilled":(I||k.data!==O.value)&&P();break;case"rejected":(!I||k.error!==O.reason)&&P();break}}return k}updateResult(){const t=A(this,Vt),r=this.createResult(A(this,qe),this.options);if(se(this,Nn,A(this,qe).state),se(this,us,this.options),A(this,Nn).data!==void 0&&se(this,fs,A(this,qe)),zi(r,t))return;se(this,Vt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!A(this,hs).size)return!0;const a=new Set(o??A(this,hs));return this.options.throwOnError&&a.add("error"),Object.keys(A(this,Vt)).some(i=>{const c=i;return A(this,Vt)[c]!==t[c]&&a.has(c)})};Me(this,We,Zf).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,We,Ji).call(this)}},Kt=new WeakMap,qe=new WeakMap,uo=new WeakMap,Vt=new WeakMap,Nn=new WeakMap,us=new WeakMap,$r=new WeakMap,fn=new WeakMap,fo=new WeakMap,ds=new WeakMap,fs=new WeakMap,Rn=new WeakMap,Pn=new WeakMap,hn=new WeakMap,hs=new WeakMap,We=new WeakSet,Vs=function(t){Me(this,We,rl).call(this);let r=A(this,qe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Yi=function(){Me(this,We,el).call(this);const t=vn(this.options.staleTime,A(this,qe));if(Js.isServer()||A(this,Vt).isStale||!Vi(t))return;const n=Vf(A(this,Vt).dataUpdatedAt,t)+1;se(this,Rn,Tn.setTimeout(()=>{A(this,Vt).isStale||this.updateResult()},n))},Zi=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(A(this,qe)):this.options.refetchInterval)??!1},Xi=function(t){Me(this,We,tl).call(this),se(this,hn,t),!(Js.isServer()||sr(this.options.enabled,A(this,qe))===!1||!Vi(A(this,hn))||A(this,hn)===0)&&se(this,Pn,Tn.setInterval(()=>{(this.options.refetchIntervalInBackground||$l.isFocused())&&Me(this,We,Vs).call(this)},A(this,hn)))},Ji=function(){Me(this,We,Yi).call(this),Me(this,We,Xi).call(this,Me(this,We,Zi).call(this))},el=function(){A(this,Rn)!==void 0&&(Tn.clearTimeout(A(this,Rn)),se(this,Rn,void 0))},tl=function(){A(this,Pn)!==void 0&&(Tn.clearInterval(A(this,Pn)),se(this,Pn,void 0))},rl=function(){const t=A(this,Kt).getQueryCache().build(A(this,Kt),this.options);if(t===A(this,qe))return;const r=A(this,qe);se(this,qe,t),se(this,uo,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Zf=function(t){kt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(A(this,Vt))}),A(this,Kt).getQueryCache().notify({query:A(this,qe),type:"observerResultsUpdated"})})},Mf);function Vg(e,t){return sr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&sr(t.retryOnMount,e)===!1)}function zc(e,t){return Vg(e,t)||e.state.data!==void 0&&nl(e,t,t.refetchOnMount)}function nl(e,t,r){if(sr(t.enabled,e)!==!1&&vn(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Vl(e,t)}return!1}function Qc(e,t,r,n){return(e!==t||sr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Vl(e,r)}function Vl(e,t){return sr(t.enabled,e)!==!1&&e.isStaleByTime(vn(t.staleTime,e))}function Hg(e,t){return!zi(e.getCurrentResult(),t)}var ho,Or,Pt,Fn,Nr,sn,Bf,zg=(Bf=class extends Gf{constructor(t){super();_e(this,Nr);_e(this,ho);_e(this,Or);_e(this,Pt);_e(this,Fn);se(this,ho,t.client),this.mutationId=t.mutationId,se(this,Pt,t.mutationCache),se(this,Or,[]),this.state=t.state||Qg(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,Or).includes(t)||(A(this,Or).push(t),this.clearGcTimeout(),A(this,Pt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){se(this,Or,A(this,Or).filter(r=>r!==t)),this.scheduleGc(),A(this,Pt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,Or).length||(this.state.status==="pending"?this.scheduleGc():A(this,Pt).remove(this))}continue(){var t;return((t=A(this,Fn))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,c,u,d,f,m,h,b,p,v,y,C,S,x,_,w,E;const r=()=>{Me(this,Nr,sn).call(this,{type:"continue"})},n={client:A(this,ho),meta:this.options.meta,mutationKey:this.options.mutationKey};se(this,Fn,Wf({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{Me(this,Nr,sn).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{Me(this,Nr,sn).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,Pt).canRun(this)}));const s=this.state.status==="pending",o=!A(this,Fn).canStart();try{if(s)r();else{Me(this,Nr,sn).call(this,{type:"pending",variables:t,isPaused:o}),A(this,Pt).config.onMutate&&await A(this,Pt).config.onMutate(t,this,n);const N=await((i=(a=this.options).onMutate)==null?void 0:i.call(a,t,n));N!==this.state.context&&Me(this,Nr,sn).call(this,{type:"pending",context:N,variables:t,isPaused:o})}const k=await A(this,Fn).start();return await((u=(c=A(this,Pt).config).onSuccess)==null?void 0:u.call(c,k,t,this.state.context,this,n)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,k,t,this.state.context,n)),await((h=(m=A(this,Pt).config).onSettled)==null?void 0:h.call(m,k,null,this.state.variables,this.state.context,this,n)),await((p=(b=this.options).onSettled)==null?void 0:p.call(b,k,null,t,this.state.context,n)),Me(this,Nr,sn).call(this,{type:"success",data:k}),k}catch(k){try{await((y=(v=A(this,Pt).config).onError)==null?void 0:y.call(v,k,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,k,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((_=(x=A(this,Pt).config).onSettled)==null?void 0:_.call(x,void 0,k,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((E=(w=this.options).onSettled)==null?void 0:E.call(w,void 0,k,t,this.state.context,n))}catch(N){Promise.reject(N)}throw Me(this,Nr,sn).call(this,{type:"error",error:k}),k}finally{A(this,Pt).runNext(this)}}},ho=new WeakMap,Or=new WeakMap,Pt=new WeakMap,Fn=new WeakMap,Nr=new WeakSet,sn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),kt.batch(()=>{A(this,Or).forEach(n=>{n.onMutationUpdate(t)}),A(this,Pt).notify({mutation:this,type:"updated",action:t})})},Bf);function Qg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ur,xr,po,qf,Wg=(qf=class extends mo{constructor(t={}){super();_e(this,Ur);_e(this,xr);_e(this,po);this.config=t,se(this,Ur,new Set),se(this,xr,new Map),se(this,po,0)}build(t,r,n){const s=new zg({client:t,mutationCache:this,mutationId:++jo(this,po)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){A(this,Ur).add(t);const r=Oo(t);if(typeof r=="string"){const n=A(this,xr).get(r);n?n.push(t):A(this,xr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,Ur).delete(t)){const r=Oo(t);if(typeof r=="string"){const n=A(this,xr).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&A(this,xr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Oo(t);if(typeof r=="string"){const n=A(this,xr).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Oo(t);if(typeof r=="string"){const s=(n=A(this,xr).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){kt.batch(()=>{A(this,Ur).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,Ur).clear(),A(this,xr).clear()})}getAll(){return Array.from(A(this,Ur))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Bc(r,n))}findAll(t={}){return this.getAll().filter(r=>Bc(t,r))}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return kt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},Ur=new WeakMap,xr=new WeakMap,po=new WeakMap,qf);function Oo(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Rr,$f,Gg=($f=class extends mo{constructor(t={}){super();_e(this,Rr);this.config=t,se(this,Rr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Ul(s,r);let a=this.get(o);return a||(a=new $g({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){A(this,Rr).has(t.queryHash)||(A(this,Rr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=A(this,Rr).get(t.queryHash);r&&(t.destroy(),r===t&&A(this,Rr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){kt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,Rr).get(t)}getAll(){return[...A(this,Rr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Mc(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Mc(t,n)):r}notify(t){kt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){kt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){kt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Rr=new WeakMap,$f),st,pn,mn,ps,ms,gn,gs,vs,Uf,Kg=(Uf=class{constructor(e={}){_e(this,st);_e(this,pn);_e(this,mn);_e(this,ps);_e(this,ms);_e(this,gn);_e(this,gs);_e(this,vs);se(this,st,e.queryCache||new Gg),se(this,pn,e.mutationCache||new Wg),se(this,mn,e.defaultOptions||{}),se(this,ps,new Map),se(this,ms,new Map),se(this,gn,0)}mount(){jo(this,gn)._++,A(this,gn)===1&&(se(this,gs,$l.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,st).onFocus())})),se(this,vs,da.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,st).onOnline())})))}unmount(){var e,t;jo(this,gn)._--,A(this,gn)===0&&((e=A(this,gs))==null||e.call(this),se(this,gs,void 0),(t=A(this,vs))==null||t.call(this),se(this,vs,void 0))}isFetching(e){return A(this,st).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,pn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,st).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=A(this,st).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(vn(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return A(this,st).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=A(this,st).get(n.queryHash),o=s==null?void 0:s.state.data,a=Lg(t,o);if(a!==void 0)return A(this,st).build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return kt.batch(()=>A(this,st).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,st).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=A(this,st);kt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=A(this,st);return kt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=kt.batch(()=>A(this,st).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return kt.batch(()=>(A(this,st).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=kt.batch(()=>A(this,st).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Yt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=A(this,st).build(this,t);return r.isStaleByTime(vn(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return da.isOnline()?A(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,st)}getMutationCache(){return A(this,pn)}getDefaultOptions(){return A(this,mn)}setDefaultOptions(e){se(this,mn,e)}setQueryDefaults(e,t){A(this,ps).set(Zs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,ps).values()],r={};return t.forEach(n=>{Xs(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){A(this,ms).set(Zs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,ms).values()],r={};return t.forEach(n=>{Xs(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,mn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ul(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ua&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,mn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,st).clear(),A(this,pn).clear()}},st=new WeakMap,pn=new WeakMap,mn=new WeakMap,ps=new WeakMap,ms=new WeakMap,gn=new WeakMap,gs=new WeakMap,vs=new WeakMap,Uf),Xf=Qe.createContext(void 0),Yg=e=>{const t=Qe.useContext(Xf);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Zg=({client:e,children:t})=>(Qe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(Xf.Provider,{value:e,children:t})),Jf=Qe.createContext(!1),Xg=()=>Qe.useContext(Jf);Jf.Provider;function Jg(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ev=Qe.createContext(Jg()),tv=()=>Qe.useContext(ev),rv=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?zf(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},nv=e=>{Qe.useEffect(()=>{e.clearReset()},[e])},sv=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&e.data===void 0||zf(r,[e.error,n])),ov=e=>{if(e.suspense){const r=s=>s==="static"?s:Math.max(s??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...s)=>r(n(...s)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},av=(e,t)=>e.isLoading&&e.isFetching&&!t,iv=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Wc=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function lv(e,t,r){var h,b,p,v;if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const n=Xg(),s=tv(),o=Yg(),a=o.defaultQueryOptions(e);(b=(h=o.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||b.call(h,a);const i=o.getQueryCache().get(a.queryHash);process.env.NODE_ENV!=="production"&&(a.queryFn||console.error(`[${a.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`));const c=e.subscribed!==!1;a._optimisticResults=n?"isRestoring":c?"optimistic":void 0,ov(a),rv(a,s,i),nv(s);const u=!o.getQueryCache().get(a.queryHash),[d]=Qe.useState(()=>new t(o,a)),f=d.getOptimisticResult(a),m=!n&&c;if(Qe.useSyncExternalStore(Qe.useCallback(y=>{const C=m?d.subscribe(kt.batchCalls(y)):Yt;return d.updateResult(),C},[d,m]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),Qe.useEffect(()=>{d.setOptions(a)},[a,d]),iv(a,f))throw Wc(a,d,s);if(sv({result:f,errorResetBoundary:s,throwOnError:a.throwOnError,query:i,suspense:a.suspense}))throw f.error;if((v=(p=o.getDefaultOptions().queries)==null?void 0:p._experimental_afterQuery)==null||v.call(p,a,f),a.experimental_prefetchInRender&&!Js.isServer()&&av(f,n)){const y=u?Wc(a,d,s):i==null?void 0:i.promise;y==null||y.catch(Yt).finally(()=>{d.updateResult()})}return a.notifyOnChangeProps?f:d.trackResult(f)}function zr(e,t){return lv(e,Ug)}let cv={data:""},uv=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||cv},dv=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,fv=/\/\*[^]*?\*\/| +/g,Gc=/\n+/g,cn=(e,t)=>{let r="",n="",s="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?r=o+" "+a+";":n+=o[1]=="f"?cn(a,o):o+"{"+cn(a,o[1]=="k"?"":t)+"}":typeof a=="object"?n+=cn(a,t?t.replace(/([^,])+/g,i=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,i):i?i+" "+c:c)):o):a!=null&&(o=o[1]=="-"?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=cn.p?cn.p(o,a):o+":"+a+";")}return r+(t&&s?t+"{"+s+"}":s)+n},tn={},eh=e=>{if(typeof e=="object"){let t="";for(let r in e)t+=r+eh(e[r]);return t}return e},hv=(e,t,r,n,s)=>{let o=eh(e),a=tn[o]||(tn[o]=(c=>{let u=0,d=11;for(;u<c.length;)d=101*d+c.charCodeAt(u++)>>>0;return"go"+d})(o));if(!tn[a]){let c=o!==e?e:(u=>{let d,f,m=[{}];for(;d=dv.exec(u.replace(fv,""));)d[4]?m.shift():d[3]?(f=d[3].replace(Gc," ").trim(),m.unshift(m[0][f]=m[0][f]||{})):m[0][d[1]]=d[2].replace(Gc," ").trim();return m[0]})(e);tn[a]=cn(s?{["@keyframes "+a]:c}:c,r?"":"."+a)}let i=r&&tn.g;return r&&(tn.g=tn[a]),((c,u,d,f)=>{f?u.data=u.data.replace(f,c):u.data.indexOf(c)===-1&&(u.data=d?c+u.data:u.data+c)})(tn[a],t,n,i),a},pv=(e,t,r)=>e.reduce((n,s,o)=>{let a=t[o];if(a&&a.call){let i=a(r),c=i&&i.props&&i.props.className||/^go/.test(i)&&i;a=c?"."+c:i&&typeof i=="object"?i.props?"":cn(i,""):i===!1?"":i}return n+s+(a??"")},"");function Ia(e){let t=this||{},r=e.call?e(t.p):e;return hv(r.unshift?r.raw?pv(r,[].slice.call(arguments,1),t.p):r.reduce((n,s)=>Object.assign(n,s&&s.call?s(t.p):s),{}):r,uv(t.target),t.g,t.o,t.k)}let th,sl,ol;Ia.bind({g:1});let Qr=Ia.bind({k:1});function mv(e,t,r,n){cn.p=t,th=e,sl=r,ol=n}function yn(e,t){let r=this||{};return function(){let n=arguments;function s(o,a){let i=Object.assign({},o),c=i.className||s.className;r.p=Object.assign({theme:sl&&sl()},i),r.o=/go\d/.test(c),i.className=Ia.apply(r,n)+(c?" "+c:"");let u=e;return e[0]&&(u=i.as||e,delete i.as),ol&&u[0]&&ol(i),th(u,i)}return s}}var gv=e=>typeof e=="function",fa=(e,t)=>gv(e)?e(t):e,vv=(()=>{let e=0;return()=>(++e).toString()})(),rh=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),yv=20,Hl="default",nh=(e,t)=>{let{toastLimit:r}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,r)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:n}=t;return nh(e,{type:e.toasts.find(a=>a.id===n.id)?1:0,toast:n});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(a=>a.id===s||s===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let o=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+o}))}}},Wo=[],sh={toasts:[],pausedAt:void 0,settings:{toastLimit:yv}},Pr={},oh=(e,t=Hl)=>{Pr[t]=nh(Pr[t]||sh,e),Wo.forEach(([r,n])=>{r===t&&n(Pr[t])})},ah=e=>Object.keys(Pr).forEach(t=>oh(e,t)),bv=e=>Object.keys(Pr).find(t=>Pr[t].toasts.some(r=>r.id===e)),Da=(e=Hl)=>t=>{oh(t,e)},Cv={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Sv=(e={},t=Hl)=>{let[r,n]=g.useState(Pr[t]||sh),s=g.useRef(Pr[t]);g.useEffect(()=>(s.current!==Pr[t]&&n(Pr[t]),Wo.push([t,n]),()=>{let a=Wo.findIndex(([i])=>i===t);a>-1&&Wo.splice(a,1)}),[t]);let o=r.toasts.map(a=>{var i,c,u;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((i=e[a.type])==null?void 0:i.removeDelay)||(e==null?void 0:e.removeDelay),duration:a.duration||((c=e[a.type])==null?void 0:c.duration)||(e==null?void 0:e.duration)||Cv[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...r,toasts:o}},xv=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(r==null?void 0:r.id)||vv()}),go=e=>(t,r)=>{let n=xv(t,e,r);return Da(n.toasterId||bv(n.id))({type:2,toast:n}),n.id},mt=(e,t)=>go("blank")(e,t);mt.error=go("error");mt.success=go("success");mt.loading=go("loading");mt.custom=go("custom");mt.dismiss=(e,t)=>{let r={type:3,toastId:e};t?Da(t)(r):ah(r)};mt.dismissAll=e=>mt.dismiss(void 0,e);mt.remove=(e,t)=>{let r={type:4,toastId:e};t?Da(t)(r):ah(r)};mt.removeAll=e=>mt.remove(void 0,e);mt.promise=(e,t,r)=>{let n=mt.loading(t.loading,{...r,...r==null?void 0:r.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let o=t.success?fa(t.success,s):void 0;return o?mt.success(o,{id:n,...r,...r==null?void 0:r.success}):mt.dismiss(n),s}).catch(s=>{let o=t.error?fa(t.error,s):void 0;o?mt.error(o,{id:n,...r,...r==null?void 0:r.error}):mt.dismiss(n)}),e};var _v=1e3,wv=(e,t="default")=>{let{toasts:r,pausedAt:n}=Sv(e,t),s=g.useRef(new Map).current,o=g.useCallback((f,m=_v)=>{if(s.has(f))return;let h=setTimeout(()=>{s.delete(f),a({type:4,toastId:f})},m);s.set(f,h)},[]);g.useEffect(()=>{if(n)return;let f=Date.now(),m=r.map(h=>{if(h.duration===1/0)return;let b=(h.duration||0)+h.pauseDuration-(f-h.createdAt);if(b<0){h.visible&&mt.dismiss(h.id);return}return setTimeout(()=>mt.dismiss(h.id,t),b)});return()=>{m.forEach(h=>h&&clearTimeout(h))}},[r,n,t]);let a=g.useCallback(Da(t),[t]),i=g.useCallback(()=>{a({type:5,time:Date.now()})},[a]),c=g.useCallback((f,m)=>{a({type:1,toast:{id:f,height:m}})},[a]),u=g.useCallback(()=>{n&&a({type:6,time:Date.now()})},[n,a]),d=g.useCallback((f,m)=>{let{reverseOrder:h=!1,gutter:b=8,defaultPosition:p}=m||{},v=r.filter(S=>(S.position||p)===(f.position||p)&&S.height),y=v.findIndex(S=>S.id===f.id),C=v.filter((S,x)=>x<y&&S.visible).length;return v.filter(S=>S.visible).slice(...h?[C+1]:[0,C]).reduce((S,x)=>S+(x.height||0)+b,0)},[r]);return g.useEffect(()=>{r.forEach(f=>{if(f.dismissed)o(f.id,f.removeDelay);else{let m=s.get(f.id);m&&(clearTimeout(m),s.delete(f.id))}})},[r,o]),{toasts:r,handlers:{updateHeight:c,startPause:i,endPause:u,calculateOffset:d}}},Tv=Qr`
2
2
  from {
3
3
  transform: scale(0) rotate(45deg);
4
4
  opacity: 0;
@@ -6,7 +6,7 @@ from {
6
6
  to {
7
7
  transform: scale(1) rotate(45deg);
8
8
  opacity: 1;
9
- }`,vg=Tr`
9
+ }`,Ev=Qr`
10
10
  from {
11
11
  transform: scale(0);
12
12
  opacity: 0;
@@ -14,7 +14,7 @@ from {
14
14
  to {
15
15
  transform: scale(1);
16
16
  opacity: 1;
17
- }`,yg=Tr`
17
+ }`,kv=Qr`
18
18
  from {
19
19
  transform: scale(0) rotate(90deg);
20
20
  opacity: 0;
@@ -22,7 +22,7 @@ from {
22
22
  to {
23
23
  transform: scale(1) rotate(90deg);
24
24
  opacity: 1;
25
- }`,bg=Hr("div")`
25
+ }`,Av=yn("div")`
26
26
  width: 20px;
27
27
  opacity: 0;
28
28
  height: 20px;
@@ -31,14 +31,14 @@ to {
31
31
  position: relative;
32
32
  transform: rotate(45deg);
33
33
 
34
- animation: ${gg} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
34
+ animation: ${Tv} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
35
35
  forwards;
36
36
  animation-delay: 100ms;
37
37
 
38
38
  &:after,
39
39
  &:before {
40
40
  content: '';
41
- animation: ${vg} 0.15s ease-out forwards;
41
+ animation: ${Ev} 0.15s ease-out forwards;
42
42
  animation-delay: 150ms;
43
43
  position: absolute;
44
44
  border-radius: 3px;
@@ -51,18 +51,18 @@ to {
51
51
  }
52
52
 
53
53
  &:before {
54
- animation: ${yg} 0.15s ease-out forwards;
54
+ animation: ${kv} 0.15s ease-out forwards;
55
55
  animation-delay: 180ms;
56
56
  transform: rotate(90deg);
57
57
  }
58
- `,Cg=Tr`
58
+ `,Lv=Qr`
59
59
  from {
60
60
  transform: rotate(0deg);
61
61
  }
62
62
  to {
63
63
  transform: rotate(360deg);
64
64
  }
65
- `,Sg=Hr("div")`
65
+ `,Iv=yn("div")`
66
66
  width: 12px;
67
67
  height: 12px;
68
68
  box-sizing: border-box;
@@ -70,8 +70,8 @@ to {
70
70
  border-radius: 100%;
71
71
  border-color: ${e=>e.secondary||"#e0e0e0"};
72
72
  border-right-color: ${e=>e.primary||"#616161"};
73
- animation: ${Cg} 1s linear infinite;
74
- `,_g=Tr`
73
+ animation: ${Lv} 1s linear infinite;
74
+ `,Dv=Qr`
75
75
  from {
76
76
  transform: scale(0) rotate(45deg);
77
77
  opacity: 0;
@@ -79,7 +79,7 @@ from {
79
79
  to {
80
80
  transform: scale(1) rotate(45deg);
81
81
  opacity: 1;
82
- }`,wg=Tr`
82
+ }`,jv=Qr`
83
83
  0% {
84
84
  height: 0;
85
85
  width: 0;
@@ -93,7 +93,7 @@ to {
93
93
  100% {
94
94
  opacity: 1;
95
95
  height: 10px;
96
- }`,xg=Hr("div")`
96
+ }`,Ov=yn("div")`
97
97
  width: 20px;
98
98
  opacity: 0;
99
99
  height: 20px;
@@ -102,13 +102,13 @@ to {
102
102
  position: relative;
103
103
  transform: rotate(45deg);
104
104
 
105
- animation: ${_g} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
105
+ animation: ${Dv} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
106
106
  forwards;
107
107
  animation-delay: 100ms;
108
108
  &:after {
109
109
  content: '';
110
110
  box-sizing: border-box;
111
- animation: ${wg} 0.2s ease-out forwards;
111
+ animation: ${jv} 0.2s ease-out forwards;
112
112
  opacity: 0;
113
113
  animation-delay: 200ms;
114
114
  position: absolute;
@@ -120,16 +120,16 @@ to {
120
120
  height: 10px;
121
121
  width: 6px;
122
122
  }
123
- `,Tg=Hr("div")`
123
+ `,Nv=yn("div")`
124
124
  position: absolute;
125
- `,Eg=Hr("div")`
125
+ `,Rv=yn("div")`
126
126
  position: relative;
127
127
  display: flex;
128
128
  justify-content: center;
129
129
  align-items: center;
130
130
  min-width: 20px;
131
131
  min-height: 20px;
132
- `,Ag=Tr`
132
+ `,Pv=Qr`
133
133
  from {
134
134
  transform: scale(0.6);
135
135
  opacity: 0.4;
@@ -137,20 +137,20 @@ from {
137
137
  to {
138
138
  transform: scale(1);
139
139
  opacity: 1;
140
- }`,kg=Hr("div")`
140
+ }`,Fv=yn("div")`
141
141
  position: relative;
142
142
  transform: scale(0.6);
143
143
  opacity: 0.4;
144
144
  min-width: 20px;
145
- animation: ${Ag} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
145
+ animation: ${Pv} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
146
146
  forwards;
147
- `,Ig=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Me.createElement(kg,null,t):t:r==="blank"?null:Me.createElement(Eg,null,Me.createElement(Sg,{...n}),r!=="loading"&&Me.createElement(Tg,null,r==="error"?Me.createElement(bg,{...n}):Me.createElement(xg,{...n})))},Dg=e=>`
147
+ `,Mv=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return t!==void 0?typeof t=="string"?Qe.createElement(Fv,null,t):t:r==="blank"?null:Qe.createElement(Rv,null,Qe.createElement(Iv,{...n}),r!=="loading"&&Qe.createElement(Nv,null,r==="error"?Qe.createElement(Av,{...n}):Qe.createElement(Ov,{...n})))},Bv=e=>`
148
148
  0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
149
149
  100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
150
- `,Lg=e=>`
150
+ `,qv=e=>`
151
151
  0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
152
152
  100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
153
- `,Og="0%{opacity:0;} 100%{opacity:1;}",Ng="0%{opacity:1;} 100%{opacity:0;}",jg=Hr("div")`
153
+ `,$v="0%{opacity:0;} 100%{opacity:1;}",Uv="0%{opacity:1;} 100%{opacity:0;}",Vv=yn("div")`
154
154
  display: flex;
155
155
  align-items: center;
156
156
  background: #fff;
@@ -162,338 +162,338 @@ to {
162
162
  pointer-events: auto;
163
163
  padding: 8px 10px;
164
164
  border-radius: 8px;
165
- `,Pg=Hr("div")`
165
+ `,Hv=yn("div")`
166
166
  display: flex;
167
167
  justify-content: center;
168
168
  margin: 4px 10px;
169
169
  color: inherit;
170
170
  flex: 1 1 auto;
171
171
  white-space: pre-line;
172
- `,Rg=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=sf()?[Og,Ng]:[Dg(r),Lg(r)];return{animation:t?`${Tr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Tr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fg=Me.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?Rg(e.position||t||"top-center",e.visible):{opacity:0},i=Me.createElement(Ig,{toast:e}),o=Me.createElement(Pg,{...e.ariaProps},Vi(e.message,e));return Me.createElement(jg,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:i,message:o}):Me.createElement(Me.Fragment,null,i,o))});og(Me.createElement);var Mg=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let i=Me.useCallback(o=>{if(o){let a=()=>{let c=o.getBoundingClientRect().height;n(e,c)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Me.createElement("div",{ref:i,className:t,style:r},s)},Bg=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:sf()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},qg=ao`
172
+ `,zv=(e,t)=>{let r=e.includes("top")?1:-1,[n,s]=rh()?[$v,Uv]:[Bv(r),qv(r)];return{animation:t?`${Qr(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Qr(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Qv=Qe.memo(({toast:e,position:t,style:r,children:n})=>{let s=e.height?zv(e.position||t||"top-center",e.visible):{opacity:0},o=Qe.createElement(Mv,{toast:e}),a=Qe.createElement(Hv,{...e.ariaProps},fa(e.message,e));return Qe.createElement(Vv,{className:e.className,style:{...s,...r,...e.style}},typeof n=="function"?n({icon:o,message:a}):Qe.createElement(Qe.Fragment,null,o,a))});mv(Qe.createElement);var Wv=({id:e,className:t,style:r,onHeightUpdate:n,children:s})=>{let o=Qe.useCallback(a=>{if(a){let i=()=>{let c=a.getBoundingClientRect().height;n(e,c)};i(),new MutationObserver(i).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return Qe.createElement("div",{ref:o,className:t,style:r},s)},Gv=(e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:rh()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...s}},Kv=Ia`
173
173
  z-index: 9999;
174
174
  > * {
175
175
  pointer-events: auto;
176
176
  }
177
- `,hi=16,$g=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:i,containerStyle:o,containerClassName:a})=>{let{toasts:c,handlers:u}=mg(r,i);return Me.createElement("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:hi,left:hi,right:hi,bottom:hi,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(d=>{let f=d.position||t,m=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),p=Bg(f,m);return Me.createElement(Mg,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?qg:"",style:p},d.type==="custom"?Vi(d.message,d):s?s(d):Me.createElement(Fg,{toast:d,position:f}))}))},Se=at;function Ug(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const co=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ss(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function vl(e){return"nodeType"in e}function Lt(e){var t,r;return e?ss(e)?e:vl(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function yl(e){const{Document:t}=Lt(e);return e instanceof t}function Ks(e){return ss(e)?!1:e instanceof Lt(e).HTMLElement}function uf(e){return e instanceof Lt(e).SVGElement}function is(e){return e?ss(e)?e.document:vl(e)?yl(e)?e:Ks(e)||uf(e)?e.ownerDocument:document:document:document}const ir=co?g.useLayoutEffect:g.useEffect;function uo(e){const t=g.useRef(e);return ir(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function zg(){const e=g.useRef(null),t=g.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function js(e,t){t===void 0&&(t=[e]);const r=g.useRef(e);return ir(()=>{r.current!==e&&(r.current=e)},t),r}function Ys(e,t){const r=g.useRef();return g.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Hi(e){const t=uo(e),r=g.useRef(null),n=g.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function Qi(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let Fo={};function Zs(e,t){return g.useMemo(()=>{if(t)return t;const r=Fo[e]==null?0:Fo[e]+1;return Fo[e]=r,e+"-"+r},[e,t])}function df(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((i,o)=>{const a=Object.entries(o);for(const[c,u]of a){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const Mn=df(1),Ps=df(-1);function Vg(e){return"clientX"in e&&"clientY"in e}function fo(e){if(!e)return!1;const{KeyboardEvent:t}=Lt(e.target);return t&&e instanceof t}function Hg(e){if(!e)return!1;const{TouchEvent:t}=Lt(e.target);return t&&e instanceof t}function Wi(e){if(Hg(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Vg(e)?{x:e.clientX,y:e.clientY}:null}const Vr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Vr.Translate.toString(e),Vr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),fc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Qg(e){return e.matches(fc)?e:e.querySelector(fc)}const Wg={display:"none"};function Gg(e){let{id:t,value:r}=e;return g.createElement("div",{id:t,style:Wg},r)}function Kg(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function Yg(){const[e,t]=g.useState("");return{announce:g.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ff=g.createContext(null);function Zg(e){const t=g.useContext(ff);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Xg(){const[e]=g.useState(()=>new Set),t=g.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[g.useCallback(n=>{let{type:s,event:i}=n;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const Jg={draggable:`
177
+ `,No=16,Yv=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:s,toasterId:o,containerStyle:a,containerClassName:i})=>{let{toasts:c,handlers:u}=wv(r,o);return Qe.createElement("div",{"data-rht-toaster":o||"",style:{position:"fixed",zIndex:9999,top:No,left:No,right:No,bottom:No,pointerEvents:"none",...a},className:i,onMouseEnter:u.startPause,onMouseLeave:u.endPause},c.map(d=>{let f=d.position||t,m=u.calculateOffset(d,{reverseOrder:e,gutter:n,defaultPosition:t}),h=Gv(f,m);return Qe.createElement(Wv,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Kv:"",style:h},d.type==="custom"?fa(d.message,d):s?s(d):Qe.createElement(Qv,{toast:d,position:f}))}))},Se=mt;function Zv(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>n=>{t.forEach(s=>s(n))},t)}const ja=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function _s(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zl(e){return"nodeType"in e}function Ht(e){var t,r;return e?_s(e)?e:zl(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Ql(e){const{Document:t}=Ht(e);return e instanceof t}function vo(e){return _s(e)?!1:e instanceof Ht(e).HTMLElement}function ih(e){return e instanceof Ht(e).SVGElement}function ws(e){return e?_s(e)?e.document:zl(e)?Ql(e)?e:vo(e)||ih(e)?e.ownerDocument:document:document:document}const wr=ja?g.useLayoutEffect:g.useEffect;function Oa(e){const t=g.useRef(e);return wr(()=>{t.current=e}),g.useCallback(function(){for(var r=arguments.length,n=new Array(r),s=0;s<r;s++)n[s]=arguments[s];return t.current==null?void 0:t.current(...n)},[])}function Xv(){const e=g.useRef(null),t=g.useCallback((n,s)=>{e.current=setInterval(n,s)},[]),r=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function eo(e,t){t===void 0&&(t=[e]);const r=g.useRef(e);return wr(()=>{r.current!==e&&(r.current=e)},t),r}function yo(e,t){const r=g.useRef();return g.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function ha(e){const t=Oa(e),r=g.useRef(null),n=g.useCallback(s=>{s!==r.current&&(t==null||t(s,r.current)),r.current=s},[]);return[r,n]}function pa(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let ci={};function bo(e,t){return g.useMemo(()=>{if(t)return t;const r=ci[e]==null?0:ci[e]+1;return ci[e]=r,e+"-"+r},[e,t])}function lh(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),s=1;s<r;s++)n[s-1]=arguments[s];return n.reduce((o,a)=>{const i=Object.entries(a);for(const[c,u]of i){const d=o[c];d!=null&&(o[c]=d+e*u)}return o},{...t})}}const ns=lh(1),to=lh(-1);function Jv(e){return"clientX"in e&&"clientY"in e}function Na(e){if(!e)return!1;const{KeyboardEvent:t}=Ht(e.target);return t&&e instanceof t}function ey(e){if(!e)return!1;const{TouchEvent:t}=Ht(e.target);return t&&e instanceof t}function ma(e){if(ey(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return Jv(e)?{x:e.clientX,y:e.clientY}:null}const Wr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Wr.Translate.toString(e),Wr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Kc="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ty(e){return e.matches(Kc)?e:e.querySelector(Kc)}const ry={display:"none"};function ny(e){let{id:t,value:r}=e;return g.createElement("div",{id:t,style:ry},r)}function sy(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:s,role:"status","aria-live":n,"aria-atomic":!0},r)}function oy(){const[e,t]=g.useState("");return{announce:g.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const ch=g.createContext(null);function ay(e){const t=g.useContext(ch);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function iy(){const[e]=g.useState(()=>new Set),t=g.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[g.useCallback(n=>{let{type:s,event:o}=n;e.forEach(a=>{var i;return(i=a[s])==null?void 0:i.call(a,o)})},[e]),t]}const ly={draggable:`
178
178
  To pick up a draggable item, press the space bar.
179
179
  While dragging, use the arrow keys to move the item.
180
180
  Press space again to drop the item in its new position, or press escape to cancel.
181
- `},ev={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function tv(e){let{announcements:t=ev,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=Jg}=e;const{announce:i,announcement:o}=Yg(),a=Zs("DndLiveRegion"),[c,u]=g.useState(!1);if(g.useEffect(()=>{u(!0)},[]),Zg(g.useMemo(()=>({onDragStart(f){let{active:m}=f;i(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:p}=f;t.onDragMove&&i(t.onDragMove({active:m,over:p}))},onDragOver(f){let{active:m,over:p}=f;i(t.onDragOver({active:m,over:p}))},onDragEnd(f){let{active:m,over:p}=f;i(t.onDragEnd({active:m,over:p}))},onDragCancel(f){let{active:m,over:p}=f;i(t.onDragCancel({active:m,over:p}))}}),[i,t])),!c)return null;const d=g.createElement(g.Fragment,null,g.createElement(Gg,{id:n,value:s.draggable}),g.createElement(Kg,{id:a,announcement:o}));return r?xr.createPortal(d,r):d}var ot;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ot||(ot={}));function Gi(){}function ja(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function hf(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const or=Object.freeze({x:0,y:0});function pf(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rv(e,t){const r=Wi(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function mf(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function nv(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function hc(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function gf(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function pc(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const sv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=pc(t,t.left,t.top),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=pf(pc(c),s);i.push({id:a,data:{droppableContainer:o,value:u}})}}return i.sort(mf)},iv=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=hc(t),i=[];for(const o of n){const{id:a}=o,c=r.get(a);if(c){const u=hc(c),d=s.reduce((m,p,b)=>m+pf(u[b],p),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:f}})}}return i.sort(mf)};function ov(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-n,a=i-r;if(n<s&&r<i){const c=t.width*t.height,u=e.width*e.height,d=o*a,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const av=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const i of n){const{id:o}=i,a=r.get(o);if(a){const c=ov(a,t);c>0&&s.push({id:o,data:{droppableContainer:i,value:c}})}}return s.sort(nv)};function lv(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function vf(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:or}function cv(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...r})}}const uv=cv(1);function yf(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function dv(e,t,r){const n=yf(t);if(!n)return e;const{scaleX:s,scaleY:i,x:o,y:a}=n,c=e.left-o-(1-s)*parseFloat(r),u=e.top-a-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const fv={ignoreTransform:!1};function os(e,t){t===void 0&&(t=fv);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Lt(e).getComputedStyle(e);u&&(r=dv(r,u,d))}const{top:n,left:s,width:i,height:o,bottom:a,right:c}=r;return{top:n,left:s,width:i,height:o,bottom:a,right:c}}function mc(e){return os(e,{ignoreTransform:!0})}function hv(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function pv(e,t){return t===void 0&&(t=Lt(e).getComputedStyle(e)),t.position==="fixed"}function mv(e,t){t===void 0&&(t=Lt(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?r.test(i):!1})}function ho(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(yl(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!Ks(s)||uf(s)||r.includes(s))return r;const i=Lt(e).getComputedStyle(s);return s!==e&&mv(s,i)&&r.push(s),pv(s,i)?r:n(s.parentNode)}return e?n(e):r}function bf(e){const[t]=ho(e,1);return t??null}function Mo(e){return!co||!e?null:ss(e)?e:vl(e)?yl(e)||e===is(e).scrollingElement?window:Ks(e)?e:null:null}function Cf(e){return ss(e)?e.scrollX:e.scrollLeft}function Sf(e){return ss(e)?e.scrollY:e.scrollTop}function Pa(e){return{x:Cf(e),y:Sf(e)}}var pt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pt||(pt={}));function _f(e){return!co||!e?!1:e===document.scrollingElement}function wf(e){const t={x:0,y:0},r=_f(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=n.y,a=e.scrollLeft>=n.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:n,minScroll:t}}const gv={x:.2,y:.2};function vv(e,t,r,n,s){let{top:i,left:o,right:a,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=gv);const{isTop:u,isBottom:d,isLeft:f,isRight:m}=wf(e),p={x:0,y:0},b={x:0,y:0},h={height:t.height*s.y,width:t.width*s.x};return!u&&i<=t.top+h.height?(p.y=pt.Backward,b.y=n*Math.abs((t.top+h.height-i)/h.height)):!d&&c>=t.bottom-h.height&&(p.y=pt.Forward,b.y=n*Math.abs((t.bottom-h.height-c)/h.height)),!m&&a>=t.right-h.width?(p.x=pt.Forward,b.x=n*Math.abs((t.right-h.width-a)/h.width)):!f&&o<=t.left+h.width&&(p.x=pt.Backward,b.x=n*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:b}}function yv(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function xf(e){return e.reduce((t,r)=>Mn(t,Pa(r)),or)}function bv(e){return e.reduce((t,r)=>t+Cf(r),0)}function Cv(e){return e.reduce((t,r)=>t+Sf(r),0)}function Tf(e,t){if(t===void 0&&(t=os),!e)return;const{top:r,left:n,bottom:s,right:i}=t(e);bf(e)&&(s<=0||i<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Sv=[["x",["left","right"],bv],["y",["top","bottom"],Cv]];class bl{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=ho(r),s=xf(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of Sv)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=a(n),d=s[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Es{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function _v(e){const{EventTarget:t}=Lt(e);return e instanceof t?e:is(e)}function Bo(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var Zt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Zt||(Zt={}));function gc(e){e.preventDefault()}function wv(e){e.stopPropagation()}var Oe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Oe||(Oe={}));const Ef={start:[Oe.Space,Oe.Enter],cancel:[Oe.Esc],end:[Oe.Space,Oe.Enter,Oe.Tab]},xv=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Oe.Right:return{...r,x:r.x+25};case Oe.Left:return{...r,x:r.x-25};case Oe.Down:return{...r,y:r.y+25};case Oe.Up:return{...r,y:r.y-25}}};class Cl{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Es(is(r)),this.windowListeners=new Es(Lt(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Zt.Resize,this.handleCancel),this.windowListeners.add(Zt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Zt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Tf(n),r(or)}handleKeyDown(t){if(fo(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:i=Ef,coordinateGetter:o=xv,scrollBehavior:a="smooth"}=s,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:or;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:r,context:n.current,currentCoordinates:d});if(f){const m=Ps(f,d),p={x:0,y:0},{scrollableAncestors:b}=n.current;for(const h of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:_,maxScroll:x,minScroll:E}=wf(h),D=yv(h),T={x:Math.min(v===Oe.Right?D.right-D.width/2:D.right,Math.max(v===Oe.Right?D.left:D.left+D.width/2,f.x)),y:Math.min(v===Oe.Down?D.bottom-D.height/2:D.bottom,Math.max(v===Oe.Down?D.top:D.top+D.height/2,f.y))},j=v===Oe.Right&&!C||v===Oe.Left&&!S,P=v===Oe.Down&&!_||v===Oe.Up&&!y;if(j&&T.x!==f.x){const O=h.scrollLeft+m.x,N=v===Oe.Right&&O<=x.x||v===Oe.Left&&O>=E.x;if(N&&!m.y){h.scrollTo({left:O,behavior:a});return}N?p.x=h.scrollLeft-O:p.x=v===Oe.Right?h.scrollLeft-x.x:h.scrollLeft-E.x,p.x&&h.scrollBy({left:-p.x,behavior:a});break}else if(P&&T.y!==f.y){const O=h.scrollTop+m.y,N=v===Oe.Down&&O<=x.y||v===Oe.Up&&O>=E.y;if(N&&!m.x){h.scrollTo({top:O,behavior:a});return}N?p.y=h.scrollTop-O:p.y=v===Oe.Down?h.scrollTop-x.y:h.scrollTop-E.y,p.y&&h.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Mn(Ps(f,this.referenceCoordinates),p))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Cl.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Ef,onActivation:s}=t,{active:i}=r;const{code:o}=e.nativeEvent;if(n.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function vc(e){return!!(e&&"distance"in e)}function yc(e){return!!(e&&"delay"in e)}class Sl{constructor(t,r,n){var s;n===void 0&&(n=_v(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:i}=t,{target:o}=i;this.props=t,this.events=r,this.document=is(o),this.documentListeners=new Es(this.document),this.listeners=new Es(n),this.windowListeners=new Es(Lt(o)),this.initialCoordinates=(s=Wi(i))!=null?s:or,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Zt.Resize,this.handleCancel),this.windowListeners.add(Zt.DragStart,gc),this.windowListeners.add(Zt.VisibilityChange,this.handleCancel),this.windowListeners.add(Zt.ContextMenu,gc),this.documentListeners.add(Zt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(yc(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(vc(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(Zt.Click,wv,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Zt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const c=(r=Wi(t))!=null?r:or,u=Ps(s,c);if(!n&&a){if(vc(a)){if(a.tolerance!=null&&Bo(u,a.tolerance))return this.handleCancel();if(Bo(u,a.distance))return this.handleStart()}if(yc(a)&&Bo(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),o(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Oe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Tv={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class po extends Sl{constructor(t){const{event:r}=t,n=is(r.target);super(t,Tv,n)}}po.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Ev={move:{name:"mousemove"},end:{name:"mouseup"}};var Ra;(function(e){e[e.RightClick=2]="RightClick"})(Ra||(Ra={}));class Av extends Sl{constructor(t){super(t,Ev,is(t.event.target))}}Av.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Ra.RightClick?!1:(n==null||n({event:r}),!0)}}];const qo={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class kv extends Sl{constructor(t){super(t,qo)}static setup(){return window.addEventListener(qo.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(qo.move.name,t)};function t(){}}}kv.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var As;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(As||(As={}));var Ki;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ki||(Ki={}));function Iv(e){let{acceleration:t,activator:r=As.Pointer,canScroll:n,draggingRect:s,enabled:i,interval:o=5,order:a=Ki.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:m}=e;const p=Lv({delta:f,disabled:!i}),[b,h]=zg(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),C=g.useMemo(()=>{switch(r){case As.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case As.DraggableRect:return s}},[r,s,c]),S=g.useRef(null),_=g.useCallback(()=>{const E=S.current;if(!E)return;const D=v.current.x*y.current.x,T=v.current.y*y.current.y;E.scrollBy(D,T)},[]),x=g.useMemo(()=>a===Ki.TreeOrder?[...u].reverse():u,[a,u]);g.useEffect(()=>{if(!i||!u.length||!C){h();return}for(const E of x){if((n==null?void 0:n(E))===!1)continue;const D=u.indexOf(E),T=d[D];if(!T)continue;const{direction:j,speed:P}=vv(E,T,C,t,m);for(const O of["x","y"])p[O][j[O]]||(P[O]=0,j[O]=0);if(P.x>0||P.y>0){h(),S.current=E,b(_,o),v.current=P,y.current=j;return}}v.current={x:0,y:0},y.current={x:0,y:0},h()},[t,_,n,h,i,o,JSON.stringify(C),JSON.stringify(p),b,u,x,d,JSON.stringify(m)])}const Dv={x:{[pt.Backward]:!1,[pt.Forward]:!1},y:{[pt.Backward]:!1,[pt.Forward]:!1}};function Lv(e){let{delta:t,disabled:r}=e;const n=Qi(t);return Ys(s=>{if(r||!n||!s)return Dv;const i={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[pt.Backward]:s.x[pt.Backward]||i.x===-1,[pt.Forward]:s.x[pt.Forward]||i.x===1},y:{[pt.Backward]:s.y[pt.Backward]||i.y===-1,[pt.Forward]:s.y[pt.Forward]||i.y===1}}},[r,t,n])}function Ov(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return Ys(s=>{var i;return t==null?null:(i=n??s)!=null?i:null},[n,t])}function Nv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,n)}));return[...r,...i]},[]),[e,t])}var Rs;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Rs||(Rs={}));var Fa;(function(e){e.Optimized="optimized"})(Fa||(Fa={}));const bc=new Map;function jv(e,t){let{dragging:r,dependencies:n,config:s}=t;const[i,o]=g.useState(null),{frequency:a,measure:c,strategy:u}=s,d=g.useRef(e),f=v(),m=js(f),p=g.useCallback(function(y){y===void 0&&(y=[]),!m.current&&o(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[m]),b=g.useRef(null),h=Ys(y=>{if(f&&!r)return bc;if(!y||y===bc||d.current!==e||i!=null){const C=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const _=S.node.current,x=_?new bl(c(_),_):null;S.rect.current=x,x&&C.set(S.id,x)}return C}return y},[e,i,r,f,c]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{f||p()},[r,f]),g.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),g.useEffect(()=>{f||typeof a!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null},a))},[a,f,p,...n]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:i!=null};function v(){switch(u){case Rs.Always:return!1;case Rs.BeforeDragging:return r;default:return!r}}}function _l(e,t){return Ys(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Pv(e,t){return _l(e,t)}function Rv(e){let{callback:t,disabled:r}=e;const n=uo(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(n)},[n,r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function mo(e){let{callback:t,disabled:r}=e;const n=uo(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(n)},[r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Fv(e){return new bl(os(e),e)}function Cc(e,t,r){t===void 0&&(t=Fv);const[n,s]=g.useState(null);function i(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=Rv({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=mo({callback:i});return ir(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),n}function Mv(e){const t=_l(e);return vf(e,t)}const Sc=[];function Bv(e){const t=g.useRef(e),r=Ys(n=>e?n&&n!==Sc&&e&&t.current&&e.parentNode===t.current.parentNode?n:ho(e):Sc,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function qv(e){const[t,r]=g.useState(null),n=g.useRef(e),s=g.useCallback(i=>{const o=Mo(i.target);o&&r(a=>a?(a.set(o,Pa(o)),new Map(a)):null)},[]);return g.useEffect(()=>{const i=n.current;if(e!==i){o(i);const a=e.map(c=>{const u=Mo(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Pa(u)]):null}).filter(c=>c!=null);r(a.length?new Map(a):null),n.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(c=>{const u=Mo(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Mn(i,o),or):xf(e):or,[e,t])}function _c(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==or;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?Ps(e,r.current):or}function $v(e){g.useEffect(()=>{if(!co)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Uv(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:i}=n;return r[s]=o=>{i(o,t)},r},{}),[e,t])}function Af(e){return g.useMemo(()=>e?hv(e):null,[e])}const wc=[];function zv(e,t){t===void 0&&(t=os);const[r]=e,n=Af(r?Lt(r):null),[s,i]=g.useState(wc);function o(){i(()=>e.length?e.map(c=>_f(c)?n:new bl(t(c),c)):wc)}const a=mo({callback:o});return ir(()=>{a==null||a.disconnect(),o(),e.forEach(c=>a==null?void 0:a.observe(c))},[e]),s}function kf(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ks(t)?t:e}function Vv(e){let{measure:t}=e;const[r,n]=g.useState(null),s=g.useCallback(u=>{for(const{target:d}of u)if(Ks(d)){n(f=>{const m=t(d);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),i=mo({callback:s}),o=g.useCallback(u=>{const d=kf(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),n(d?t(d):null)},[t,i]),[a,c]=Hi(o);return g.useMemo(()=>({nodeRef:a,rect:r,setRef:c}),[r,a,c])}const Hv=[{sensor:po,options:{}},{sensor:Cl,options:{}}],Qv={current:{}},Ai={draggable:{measure:mc},droppable:{measure:mc,strategy:Rs.WhileDragging,frequency:Fa.Optimized},dragOverlay:{measure:os}};class ks extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const Wv={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ks,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Gi},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ai,measureDroppableContainers:Gi,windowRect:null,measuringScheduled:!1},If={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Gi,draggableNodes:new Map,over:null,measureDroppableContainers:Gi},Xs=g.createContext(If),Df=g.createContext(Wv);function Gv(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ks}}}function Kv(e,t){switch(t.type){case ot.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ot.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case ot.DragEnd:case ot.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ot.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new ks(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case ot.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const o=new ks(e.droppable.containers);return o.set(r,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case ot.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const i=new ks(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Yv(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=g.useContext(Xs),i=Qi(n),o=Qi(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&i&&o!=null){if(!fo(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:c,node:u}=a;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=Qg(d);if(f){f.focus();break}}})}},[n,t,s,o,i]),null}function Lf(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...n}),r):r}function Zv(e){return g.useMemo(()=>({draggable:{...Ai.draggable,...e==null?void 0:e.draggable},droppable:{...Ai.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ai.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Xv(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const i=g.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ir(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=vf(d,n);if(o||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=bf(u);m&&m.scrollBy({top:f.y,left:f.x})}},[t,o,a,n,r])}const go=g.createContext({...or,scaleX:1,scaleY:1});var Nr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Nr||(Nr={}));const Of=g.memo(function(t){var r,n,s,i;let{id:o,accessibility:a,autoScroll:c=!0,children:u,sensors:d=Hv,collisionDetection:f=av,measuring:m,modifiers:p,...b}=t;const h=g.useReducer(Kv,void 0,Gv),[v,y]=h,[C,S]=Xg(),[_,x]=g.useState(Nr.Uninitialized),E=_===Nr.Initialized,{draggable:{active:D,nodes:T,translate:j},droppable:{containers:P}}=v,O=D!=null?T.get(D):null,N=g.useRef({initial:null,translated:null}),R=g.useMemo(()=>{var ct;return D!=null?{id:D,data:(ct=O==null?void 0:O.data)!=null?ct:Qv,rect:N}:null},[D,O]),M=g.useRef(null),[$,ee]=g.useState(null),[H,te]=g.useState(null),de=js(b,Object.values(b)),fe=Zs("DndDescribedBy",o),pe=g.useMemo(()=>P.getEnabled(),[P]),ae=Zv(m),{droppableRects:we,measureDroppableContainers:ye,measuringScheduled:F}=jv(pe,{dragging:E,dependencies:[j.x,j.y],config:ae.droppable}),B=Ov(T,D),Z=g.useMemo(()=>H?Wi(H):null,[H]),he=Yr(),be=Pv(B,ae.draggable.measure);Xv({activeNode:D!=null?T.get(D):null,config:he.layoutShiftCompensation,initialRect:be,measure:ae.draggable.measure});const me=Cc(B,ae.draggable.measure,be),le=Cc(B?B.parentElement:null),ve=g.useRef({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:we,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=P.getNodeFor((r=ve.current.over)==null?void 0:r.id),Y=Vv({measure:ae.dragOverlay.measure}),ce=(n=Y.nodeRef.current)!=null?n:B,Q=E?(s=Y.rect)!=null?s:me:null,Ce=!!(Y.nodeRef.current&&Y.rect),qe=Mv(Ce?null:me),et=Af(ce?Lt(ce):null),$e=Bv(E?Te??B:null),We=zv($e),tt=Lf(p,{transform:{x:j.x-qe.x,y:j.y-qe.y,scaleX:1,scaleY:1},activatorEvent:H,active:R,activeNodeRect:me,containerNodeRect:le,draggingNodeRect:Q,over:ve.current.over,overlayNodeRect:Y.rect,scrollableAncestors:$e,scrollableAncestorRects:We,windowRect:et}),Gr=Z?Mn(Z,j):null,wn=qv($e),cs=_c(wn),Kr=_c(wn,[me]),w=Mn(tt,cs),A=Q?uv(Q,tt):null,I=R&&A?f({active:R,collisionRect:A,droppableRects:we,droppableContainers:pe,pointerCoordinates:Gr}):null,U=gf(I,"id"),[z,W]=g.useState(null),V=Ce?tt:Mn(tt,Kr),ne=lv(V,(i=z==null?void 0:z.rect)!=null?i:null,me),se=g.useRef(null),je=g.useCallback((ct,Ct)=>{let{sensor:It,options:er}=Ct;if(M.current==null)return;const Ht=T.get(M.current);if(!Ht)return;const Mt=ct.nativeEvent,cr=new It({active:M.current,activeNode:Ht,event:Mt,options:er,context:ve,onAbort(mt){if(!T.get(mt))return;const{onDragAbort:ur}=de.current,Cr={id:mt};ur==null||ur(Cr),C({type:"onDragAbort",event:Cr})},onPending(mt,Er,ur,Cr){if(!T.get(mt))return;const{onDragPending:fs}=de.current,Ar={id:mt,constraint:Er,initialCoordinates:ur,offset:Cr};fs==null||fs(Ar),C({type:"onDragPending",event:Ar})},onStart(mt){const Er=M.current;if(Er==null)return;const ur=T.get(Er);if(!ur)return;const{onDragStart:Cr}=de.current,ds={activatorEvent:Mt,active:{id:Er,data:ur.data,rect:N}};xr.unstable_batchedUpdates(()=>{Cr==null||Cr(ds),x(Nr.Initializing),y({type:ot.DragStart,initialCoordinates:mt,active:Er}),C({type:"onDragStart",event:ds}),ee(se.current),te(Mt)})},onMove(mt){y({type:ot.DragMove,coordinates:mt})},onEnd:xn(ot.DragEnd),onCancel:xn(ot.DragCancel)});se.current=cr;function xn(mt){return async function(){const{active:ur,collisions:Cr,over:ds,scrollAdjustedTranslate:fs}=ve.current;let Ar=null;if(ur&&fs){const{cancelDrop:hs}=de.current;Ar={activatorEvent:Mt,active:ur,collisions:Cr,delta:fs,over:ds},mt===ot.DragEnd&&typeof hs=="function"&&await Promise.resolve(hs(Ar))&&(mt=ot.DragCancel)}M.current=null,xr.unstable_batchedUpdates(()=>{y({type:mt}),x(Nr.Uninitialized),W(null),ee(null),te(null),se.current=null;const hs=mt===ot.DragEnd?"onDragEnd":"onDragCancel";if(Ar){const Po=de.current[hs];Po==null||Po(Ar),C({type:hs,event:Ar})}})}}},[T]),Ge=g.useCallback((ct,Ct)=>(It,er)=>{const Ht=It.nativeEvent,Mt=T.get(er);if(M.current!==null||!Mt||Ht.dndKit||Ht.defaultPrevented)return;const cr={active:Mt};ct(It,Ct.options,cr)===!0&&(Ht.dndKit={capturedBy:Ct.sensor},M.current=er,je(It,Ct))},[T,je]),st=Nv(d,Ge);$v(d),ir(()=>{me&&_===Nr.Initializing&&x(Nr.Initialized)},[me,_]),g.useEffect(()=>{const{onDragMove:ct}=de.current,{active:Ct,activatorEvent:It,collisions:er,over:Ht}=ve.current;if(!Ct||!It)return;const Mt={active:Ct,activatorEvent:It,collisions:er,delta:{x:w.x,y:w.y},over:Ht};xr.unstable_batchedUpdates(()=>{ct==null||ct(Mt),C({type:"onDragMove",event:Mt})})},[w.x,w.y]),g.useEffect(()=>{const{active:ct,activatorEvent:Ct,collisions:It,droppableContainers:er,scrollAdjustedTranslate:Ht}=ve.current;if(!ct||M.current==null||!Ct||!Ht)return;const{onDragOver:Mt}=de.current,cr=er.get(U),xn=cr&&cr.rect.current?{id:cr.id,rect:cr.rect.current,data:cr.data,disabled:cr.disabled}:null,mt={active:ct,activatorEvent:Ct,collisions:It,delta:{x:Ht.x,y:Ht.y},over:xn};xr.unstable_batchedUpdates(()=>{W(xn),Mt==null||Mt(mt),C({type:"onDragOver",event:mt})})},[U]),ir(()=>{ve.current={activatorEvent:H,active:R,activeNode:B,collisionRect:A,collisions:I,droppableRects:we,draggableNodes:T,draggingNode:ce,draggingNodeRect:Q,droppableContainers:P,over:z,scrollableAncestors:$e,scrollAdjustedTranslate:w},N.current={initial:Q,translated:A}},[R,B,I,A,T,ce,Q,we,P,z,$e,w]),Iv({...he,delta:j,draggingRect:A,pointerCoordinates:Gr,scrollableAncestors:$e,scrollableAncestorRects:We});const Vt=g.useMemo(()=>({active:R,activeNode:B,activeNodeRect:me,activatorEvent:H,collisions:I,containerNodeRect:le,dragOverlay:Y,draggableNodes:T,droppableContainers:P,droppableRects:we,over:z,measureDroppableContainers:ye,scrollableAncestors:$e,scrollableAncestorRects:We,measuringConfiguration:ae,measuringScheduled:F,windowRect:et}),[R,B,me,H,I,le,Y,T,P,we,z,ye,$e,We,ae,F,et]),us=g.useMemo(()=>({activatorEvent:H,activators:st,active:R,activeNodeRect:me,ariaDescribedById:{draggable:fe},dispatch:y,draggableNodes:T,over:z,measureDroppableContainers:ye}),[H,st,R,me,y,fe,T,z,ye]);return g.createElement(ff.Provider,{value:S},g.createElement(Xs.Provider,{value:us},g.createElement(Df.Provider,{value:Vt},g.createElement(go.Provider,{value:ne},u)),g.createElement(Yv,{disabled:(a==null?void 0:a.restoreFocus)===!1})),g.createElement(tv,{...a,hiddenTextDescribedById:fe}));function Yr(){const ct=($==null?void 0:$.autoScrollEnabled)===!1,Ct=typeof c=="object"?c.enabled===!1:c===!1,It=E&&!ct&&!Ct;return typeof c=="object"?{...c,enabled:It}:{enabled:It}}}),Jv=g.createContext(null),xc="button",ey="Draggable";function Nf(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const i=Zs(ey),{activators:o,activatorEvent:a,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:m}=g.useContext(Xs),{role:p=xc,roleDescription:b="draggable",tabIndex:h=0}=s??{},v=(c==null?void 0:c.id)===t,y=g.useContext(v?go:Jv),[C,S]=Hi(),[_,x]=Hi(),E=Uv(o,t),D=js(r);ir(()=>(f.set(t,{id:t,key:i,node:C,activatorNode:_,data:D}),()=>{const j=f.get(t);j&&j.key===i&&f.delete(t)}),[f,t]);const T=g.useMemo(()=>({role:p,tabIndex:h,"aria-disabled":n,"aria-pressed":v&&p===xc?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,p,h,v,b,d.draggable]);return{active:c,activatorEvent:a,activeNodeRect:u,attributes:T,isDragging:v,listeners:n?void 0:E,node:C,over:m,setNodeRef:S,setActivatorNodeRef:x,transform:y}}function jf(){return g.useContext(Df)}const ty="Droppable",ry={timeout:25};function ny(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const i=Zs(ty),{active:o,dispatch:a,over:c,measureDroppableContainers:u}=g.useContext(Xs),d=g.useRef({disabled:r}),f=g.useRef(!1),m=g.useRef(null),p=g.useRef(null),{disabled:b,updateMeasurementsFor:h,timeout:v}={...ry,...s},y=js(h??n),C=g.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),p.current=null},v)},[v]),S=mo({callback:C,disabled:b||!o}),_=g.useCallback((T,j)=>{S&&(j&&(S.unobserve(j),f.current=!1),T&&S.observe(T))},[S]),[x,E]=Hi(_),D=js(t);return g.useEffect(()=>{!S||!x.current||(S.disconnect(),f.current=!1,S.observe(x.current))},[x,S]),g.useEffect(()=>(a({type:ot.RegisterDroppable,element:{id:n,key:i,disabled:r,node:x,rect:m,data:D}}),()=>a({type:ot.UnregisterDroppable,key:i,id:n})),[n]),g.useEffect(()=>{r!==d.current.disabled&&(a({type:ot.SetDroppableDisabled,id:n,key:i,disabled:r}),d.current.disabled=r)},[n,i,r,a]),{active:o,rect:m,isOver:(c==null?void 0:c.id)===n,node:x,over:c,setNodeRef:E}}function sy(e){let{animation:t,children:r}=e;const[n,s]=g.useState(null),[i,o]=g.useState(null),a=Qi(r);return!r&&!n&&a&&s(a),ir(()=>{if(!i)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,i)).then(()=>{s(null)})},[t,n,i]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:o}):null)}const iy={x:0,y:0,scaleX:1,scaleY:1};function oy(e){let{children:t}=e;return g.createElement(Xs.Provider,{value:If},g.createElement(go.Provider,{value:iy},t))}const ay={position:"fixed",touchAction:"none"},ly=e=>fo(e)?"transform 250ms ease":void 0,cy=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:i,className:o,rect:a,style:c,transform:u,transition:d=ly}=e;if(!a)return null;const f=s?u:{...u,scaleX:1,scaleY:1},m={...ay,width:a.width,height:a.height,top:a.top,left:a.left,transform:Vr.Transform.toString(f),transformOrigin:s&&n?rv(n,a):void 0,transition:typeof d=="function"?d(n):d,...c};return g.createElement(r,{className:o,style:m,ref:t},i)}),uy=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,c]of Object.entries(i.active))c!==void 0&&(s[a]=r.node.style.getPropertyValue(a),r.node.style.setProperty(a,c));if(i!=null&&i.dragOverlay)for(const[a,c]of Object.entries(i.dragOverlay))c!==void 0&&n.node.style.setProperty(a,c);return o!=null&&o.active&&r.node.classList.add(o.active),o!=null&&o.dragOverlay&&n.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(s))r.node.style.setProperty(c,u);o!=null&&o.active&&r.node.classList.remove(o.active)}},dy=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Vr.Transform.toString(t)},{transform:Vr.Transform.toString(r)}]},fy={duration:250,easing:"ease",keyframes:dy,sideEffects:uy({styles:{active:{opacity:"0"}}})};function hy(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return uo((i,o)=>{if(t===null)return;const a=r.get(i);if(!a)return;const c=a.node.current;if(!c)return;const u=kf(o);if(!u)return;const{transform:d}=Lt(o).getComputedStyle(o),f=yf(d);if(!f)return;const m=typeof t=="function"?t:py(t);return Tf(c,s.draggable.measure),m({active:{id:i,data:a.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:o,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function py(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...fy,...e};return i=>{let{active:o,dragOverlay:a,transform:c,...u}=i;if(!t)return;const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/a.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/a.rect.height:1},m={x:c.x-d.x,y:c.y-d.y,...f},p=s({...u,active:o,dragOverlay:a,transform:{initial:c,final:m}}),[b]=p,h=p[p.length-1];if(JSON.stringify(b)===JSON.stringify(h))return;const v=n==null?void 0:n({active:o,dragOverlay:a,...u}),y=a.node.animate(p,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let Tc=0;function my(e){return g.useMemo(()=>{if(e!=null)return Tc++,Tc},[e])}const gy=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:p,draggableNodes:b,droppableContainers:h,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:_,windowRect:x}=jf(),E=g.useContext(go),D=my(f==null?void 0:f.id),T=Lf(o,{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:p,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:_,transform:E,windowRect:x}),j=_l(m),P=hy({config:n,draggableNodes:b,droppableContainers:h,measuringConfiguration:C}),O=j?v.setRef:void 0;return g.createElement(oy,null,g.createElement(sy,{animation:P},f&&D?g.createElement(cy,{key:D,id:f.id,ref:O,as:a,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:j,style:{zIndex:u,...s},transform:T},r):null))});/**
181
+ `},cy={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function uy(e){let{announcements:t=cy,container:r,hiddenTextDescribedById:n,screenReaderInstructions:s=ly}=e;const{announce:o,announcement:a}=oy(),i=bo("DndLiveRegion"),[c,u]=g.useState(!1);if(g.useEffect(()=>{u(!0)},[]),ay(g.useMemo(()=>({onDragStart(f){let{active:m}=f;o(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:h}=f;t.onDragMove&&o(t.onDragMove({active:m,over:h}))},onDragOver(f){let{active:m,over:h}=f;o(t.onDragOver({active:m,over:h}))},onDragEnd(f){let{active:m,over:h}=f;o(t.onDragEnd({active:m,over:h}))},onDragCancel(f){let{active:m,over:h}=f;o(t.onDragCancel({active:m,over:h}))}}),[o,t])),!c)return null;const d=g.createElement(g.Fragment,null,g.createElement(ny,{id:n,value:s.draggable}),g.createElement(sy,{id:i,announcement:a}));return r?Hr.createPortal(d,r):d}var pt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(pt||(pt={}));function ga(){}function al(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function uh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return g.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const Tr=Object.freeze({x:0,y:0});function dh(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function dy(e,t){const r=ma(e);if(!r)return"0 0";const n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}function fh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function fy(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Yc(e){let{left:t,top:r,height:n,width:s}=e;return[{x:t,y:r},{x:t+s,y:r},{x:t,y:r+n},{x:t+s,y:r+n}]}function hh(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Zc(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Xc=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Zc(t,t.left,t.top),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const u=dh(Zc(c),s);o.push({id:i,data:{droppableContainer:a,value:u}})}}return o.sort(fh)},hy=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=Yc(t),o=[];for(const a of n){const{id:i}=a,c=r.get(i);if(c){const u=Yc(c),d=s.reduce((m,h,b)=>m+dh(u[b],h),0),f=Number((d/4).toFixed(4));o.push({id:i,data:{droppableContainer:a,value:f}})}}return o.sort(fh)};function py(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=s-n,i=o-r;if(n<s&&r<o){const c=t.width*t.height,u=e.width*e.height,d=a*i,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const my=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const s=[];for(const o of n){const{id:a}=o,i=r.get(a);if(i){const c=py(i,t);c>0&&s.push({id:a,data:{droppableContainer:o,value:c}})}}return s.sort(fy)};function gy(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ph(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Tr}function vy(e){return function(r){for(var n=arguments.length,s=new Array(n>1?n-1:0),o=1;o<n;o++)s[o-1]=arguments[o];return s.reduce((a,i)=>({...a,top:a.top+e*i.y,bottom:a.bottom+e*i.y,left:a.left+e*i.x,right:a.right+e*i.x}),{...r})}}const yy=vy(1);function mh(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function by(e,t,r){const n=mh(t);if(!n)return e;const{scaleX:s,scaleY:o,x:a,y:i}=n,c=e.left-a-(1-s)*parseFloat(r),u=e.top-i-(1-o)*parseFloat(r.slice(r.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const Cy={ignoreTransform:!1};function Ts(e,t){t===void 0&&(t=Cy);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=Ht(e).getComputedStyle(e);u&&(r=by(r,u,d))}const{top:n,left:s,width:o,height:a,bottom:i,right:c}=r;return{top:n,left:s,width:o,height:a,bottom:i,right:c}}function Jc(e){return Ts(e,{ignoreTransform:!0})}function Sy(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function xy(e,t){return t===void 0&&(t=Ht(e).getComputedStyle(e)),t.position==="fixed"}function _y(e,t){t===void 0&&(t=Ht(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=t[s];return typeof o=="string"?r.test(o):!1})}function Ra(e,t){const r=[];function n(s){if(t!=null&&r.length>=t||!s)return r;if(Ql(s)&&s.scrollingElement!=null&&!r.includes(s.scrollingElement))return r.push(s.scrollingElement),r;if(!vo(s)||ih(s)||r.includes(s))return r;const o=Ht(e).getComputedStyle(s);return s!==e&&_y(s,o)&&r.push(s),xy(s,o)?r:n(s.parentNode)}return e?n(e):r}function gh(e){const[t]=Ra(e,1);return t??null}function ui(e){return!ja||!e?null:_s(e)?e:zl(e)?Ql(e)||e===ws(e).scrollingElement?window:vo(e)?e:null:null}function vh(e){return _s(e)?e.scrollX:e.scrollLeft}function yh(e){return _s(e)?e.scrollY:e.scrollTop}function il(e){return{x:vh(e),y:yh(e)}}var _t;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(_t||(_t={}));function bh(e){return!ja||!e?!1:e===document.scrollingElement}function Ch(e){const t={x:0,y:0},r=bh(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},s=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=n.y,i=e.scrollLeft>=n.x;return{isTop:s,isLeft:o,isBottom:a,isRight:i,maxScroll:n,minScroll:t}}const wy={x:.2,y:.2};function Ty(e,t,r,n,s){let{top:o,left:a,right:i,bottom:c}=r;n===void 0&&(n=10),s===void 0&&(s=wy);const{isTop:u,isBottom:d,isLeft:f,isRight:m}=Ch(e),h={x:0,y:0},b={x:0,y:0},p={height:t.height*s.y,width:t.width*s.x};return!u&&o<=t.top+p.height?(h.y=_t.Backward,b.y=n*Math.abs((t.top+p.height-o)/p.height)):!d&&c>=t.bottom-p.height&&(h.y=_t.Forward,b.y=n*Math.abs((t.bottom-p.height-c)/p.height)),!m&&i>=t.right-p.width?(h.x=_t.Forward,b.x=n*Math.abs((t.right-p.width-i)/p.width)):!f&&a<=t.left+p.width&&(h.x=_t.Backward,b.x=n*Math.abs((t.left+p.width-a)/p.width)),{direction:h,speed:b}}function Ey(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:r,right:n,bottom:s}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:s,width:e.clientWidth,height:e.clientHeight}}function Sh(e){return e.reduce((t,r)=>ns(t,il(r)),Tr)}function ky(e){return e.reduce((t,r)=>t+vh(r),0)}function Ay(e){return e.reduce((t,r)=>t+yh(r),0)}function xh(e,t){if(t===void 0&&(t=Ts),!e)return;const{top:r,left:n,bottom:s,right:o}=t(e);gh(e)&&(s<=0||o<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Ly=[["x",["left","right"],ky],["y",["top","bottom"],Ay]];class Wl{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=Ra(r),s=Sh(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,i]of Ly)for(const c of a)Object.defineProperty(this,c,{get:()=>{const u=i(n),d=s[o]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Qs{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var s;(s=this.target)==null||s.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Iy(e){const{EventTarget:t}=Ht(e);return e instanceof t?e:ws(e)}function di(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var mr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(mr||(mr={}));function eu(e){e.preventDefault()}function Dy(e){e.stopPropagation()}var $e;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})($e||($e={}));const _h={start:[$e.Space,$e.Enter],cancel:[$e.Esc],end:[$e.Space,$e.Enter,$e.Tab]},jy=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case $e.Right:return{...r,x:r.x+25};case $e.Left:return{...r,x:r.x-25};case $e.Down:return{...r,y:r.y+25};case $e.Up:return{...r,y:r.y-25}}};class Gl{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new Qs(ws(r)),this.windowListeners=new Qs(Ht(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&xh(n),r(Tr)}handleKeyDown(t){if(Na(t)){const{active:r,context:n,options:s}=this.props,{keyboardCodes:o=_h,coordinateGetter:a=jy,scrollBehavior:i="smooth"}=s,{code:c}=t;if(o.end.includes(c)){this.handleEnd(t);return}if(o.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=n.current,d=u?{x:u.left,y:u.top}:Tr;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:r,context:n.current,currentCoordinates:d});if(f){const m=to(f,d),h={x:0,y:0},{scrollableAncestors:b}=n.current;for(const p of b){const v=t.code,{isTop:y,isRight:C,isLeft:S,isBottom:x,maxScroll:_,minScroll:w}=Ch(p),E=Ey(p),k={x:Math.min(v===$e.Right?E.right-E.width/2:E.right,Math.max(v===$e.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(v===$e.Down?E.bottom-E.height/2:E.bottom,Math.max(v===$e.Down?E.top:E.top+E.height/2,f.y))},N=v===$e.Right&&!C||v===$e.Left&&!S,F=v===$e.Down&&!x||v===$e.Up&&!y;if(N&&k.x!==f.x){const I=p.scrollLeft+m.x,R=v===$e.Right&&I<=_.x||v===$e.Left&&I>=w.x;if(R&&!m.y){p.scrollTo({left:I,behavior:i});return}R?h.x=p.scrollLeft-I:h.x=v===$e.Right?p.scrollLeft-_.x:p.scrollLeft-w.x,h.x&&p.scrollBy({left:-h.x,behavior:i});break}else if(F&&k.y!==f.y){const I=p.scrollTop+m.y,R=v===$e.Down&&I<=_.y||v===$e.Up&&I>=w.y;if(R&&!m.x){p.scrollTo({top:I,behavior:i});return}R?h.y=p.scrollTop-I:h.y=v===$e.Down?p.scrollTop-_.y:p.scrollTop-w.y,h.y&&p.scrollBy({top:-h.y,behavior:i});break}}this.handleMove(t,ns(to(f,this.referenceCoordinates),h))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Gl.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=_h,onActivation:s}=t,{active:o}=r;const{code:a}=e.nativeEvent;if(n.start.includes(a)){const i=o.activatorNode.current;return i&&e.target!==i?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function tu(e){return!!(e&&"distance"in e)}function ru(e){return!!(e&&"delay"in e)}class Kl{constructor(t,r,n){var s;n===void 0&&(n=Iy(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:o}=t,{target:a}=o;this.props=t,this.events=r,this.document=ws(a),this.documentListeners=new Qs(this.document),this.listeners=new Qs(n),this.windowListeners=new Qs(Ht(a)),this.initialCoordinates=(s=ma(o))!=null?s:Tr,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(mr.Resize,this.handleCancel),this.windowListeners.add(mr.DragStart,eu),this.windowListeners.add(mr.VisibilityChange,this.handleCancel),this.windowListeners.add(mr.ContextMenu,eu),this.documentListeners.add(mr.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ru(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(tu(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:s}=this.props;s(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(mr.Click,Dy,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mr.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:s,props:o}=this,{onMove:a,options:{activationConstraint:i}}=o;if(!s)return;const c=(r=ma(t))!=null?r:Tr,u=to(s,c);if(!n&&i){if(tu(i)){if(i.tolerance!=null&&di(u,i.tolerance))return this.handleCancel();if(di(u,i.distance))return this.handleStart()}if(ru(i)&&di(u,i.tolerance))return this.handleCancel();this.handlePending(i,u);return}t.cancelable&&t.preventDefault(),a(c)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===$e.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Oy={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Pa extends Kl{constructor(t){const{event:r}=t,n=ws(r.target);super(t,Oy,n)}}Pa.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n==null||n({event:r}),!0)}}];const Ny={move:{name:"mousemove"},end:{name:"mouseup"}};var ll;(function(e){e[e.RightClick=2]="RightClick"})(ll||(ll={}));class Ry extends Kl{constructor(t){super(t,Ny,ws(t.event.target))}}Ry.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===ll.RightClick?!1:(n==null||n({event:r}),!0)}}];const fi={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Py extends Kl{constructor(t){super(t,fi)}static setup(){return window.addEventListener(fi.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(fi.move.name,t)};function t(){}}}Py.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:s}=r;return s.length>1?!1:(n==null||n({event:r}),!0)}}];var Ws;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ws||(Ws={}));var va;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(va||(va={}));function Fy(e){let{acceleration:t,activator:r=Ws.Pointer,canScroll:n,draggingRect:s,enabled:o,interval:a=5,order:i=va.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:m}=e;const h=By({delta:f,disabled:!o}),[b,p]=Xv(),v=g.useRef({x:0,y:0}),y=g.useRef({x:0,y:0}),C=g.useMemo(()=>{switch(r){case Ws.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Ws.DraggableRect:return s}},[r,s,c]),S=g.useRef(null),x=g.useCallback(()=>{const w=S.current;if(!w)return;const E=v.current.x*y.current.x,k=v.current.y*y.current.y;w.scrollBy(E,k)},[]),_=g.useMemo(()=>i===va.TreeOrder?[...u].reverse():u,[i,u]);g.useEffect(()=>{if(!o||!u.length||!C){p();return}for(const w of _){if((n==null?void 0:n(w))===!1)continue;const E=u.indexOf(w),k=d[E];if(!k)continue;const{direction:N,speed:F}=Ty(w,k,C,t,m);for(const I of["x","y"])h[I][N[I]]||(F[I]=0,N[I]=0);if(F.x>0||F.y>0){p(),S.current=w,b(x,a),v.current=F,y.current=N;return}}v.current={x:0,y:0},y.current={x:0,y:0},p()},[t,x,n,p,o,a,JSON.stringify(C),JSON.stringify(h),b,u,_,d,JSON.stringify(m)])}const My={x:{[_t.Backward]:!1,[_t.Forward]:!1},y:{[_t.Backward]:!1,[_t.Forward]:!1}};function By(e){let{delta:t,disabled:r}=e;const n=pa(t);return yo(s=>{if(r||!n||!s)return My;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[_t.Backward]:s.x[_t.Backward]||o.x===-1,[_t.Forward]:s.x[_t.Forward]||o.x===1},y:{[_t.Backward]:s.y[_t.Backward]||o.y===-1,[_t.Forward]:s.y[_t.Forward]||o.y===1}}},[r,t,n])}function qy(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return yo(s=>{var o;return t==null?null:(o=n??s)!=null?o:null},[n,t])}function $y(e,t){return g.useMemo(()=>e.reduce((r,n)=>{const{sensor:s}=n,o=s.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,n)}));return[...r,...o]},[]),[e,t])}var ro;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ro||(ro={}));var cl;(function(e){e.Optimized="optimized"})(cl||(cl={}));const nu=new Map;function Uy(e,t){let{dragging:r,dependencies:n,config:s}=t;const[o,a]=g.useState(null),{frequency:i,measure:c,strategy:u}=s,d=g.useRef(e),f=v(),m=eo(f),h=g.useCallback(function(y){y===void 0&&(y=[]),!m.current&&a(C=>C===null?y:C.concat(y.filter(S=>!C.includes(S))))},[m]),b=g.useRef(null),p=yo(y=>{if(f&&!r)return nu;if(!y||y===nu||d.current!==e||o!=null){const C=new Map;for(let S of e){if(!S)continue;if(o&&o.length>0&&!o.includes(S.id)&&S.rect.current){C.set(S.id,S.rect.current);continue}const x=S.node.current,_=x?new Wl(c(x),x):null;S.rect.current=_,_&&C.set(S.id,_)}return C}return y},[e,o,r,f,c]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{f||h()},[r,f]),g.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),g.useEffect(()=>{f||typeof i!="number"||b.current!==null||(b.current=setTimeout(()=>{h(),b.current=null},i))},[i,f,h,...n]),{droppableRects:p,measureDroppableContainers:h,measuringScheduled:o!=null};function v(){switch(u){case ro.Always:return!1;case ro.BeforeDragging:return r;default:return!r}}}function Yl(e,t){return yo(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Vy(e,t){return Yl(e,t)}function Hy(e){let{callback:t,disabled:r}=e;const n=Oa(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(n)},[n,r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Fa(e){let{callback:t,disabled:r}=e;const n=Oa(t),s=g.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(n)},[r]);return g.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function zy(e){return new Wl(Ts(e),e)}function su(e,t,r){t===void 0&&(t=zy);const[n,s]=g.useState(null);function o(){s(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??r)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const a=Hy({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),i=Fa({callback:o});return wr(()=>{o(),e?(i==null||i.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(i==null||i.disconnect(),a==null||a.disconnect())},[e]),n}function Qy(e){const t=Yl(e);return ph(e,t)}const ou=[];function Wy(e){const t=g.useRef(e),r=yo(n=>e?n&&n!==ou&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ra(e):ou,[e]);return g.useEffect(()=>{t.current=e},[e]),r}function Gy(e){const[t,r]=g.useState(null),n=g.useRef(e),s=g.useCallback(o=>{const a=ui(o.target);a&&r(i=>i?(i.set(a,il(a)),new Map(i)):null)},[]);return g.useEffect(()=>{const o=n.current;if(e!==o){a(o);const i=e.map(c=>{const u=ui(c);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,il(u)]):null}).filter(c=>c!=null);r(i.length?new Map(i):null),n.current=e}return()=>{a(e),a(o)};function a(i){i.forEach(c=>{const u=ui(c);u==null||u.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>ns(o,a),Tr):Sh(e):Tr,[e,t])}function au(e,t){t===void 0&&(t=[]);const r=g.useRef(null);return g.useEffect(()=>{r.current=null},t),g.useEffect(()=>{const n=e!==Tr;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?to(e,r.current):Tr}function Ky(e){g.useEffect(()=>{if(!ja)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r==null||r()}},e.map(t=>{let{sensor:r}=t;return r}))}function Yy(e,t){return g.useMemo(()=>e.reduce((r,n)=>{let{eventName:s,handler:o}=n;return r[s]=a=>{o(a,t)},r},{}),[e,t])}function wh(e){return g.useMemo(()=>e?Sy(e):null,[e])}const iu=[];function Zy(e,t){t===void 0&&(t=Ts);const[r]=e,n=wh(r?Ht(r):null),[s,o]=g.useState(iu);function a(){o(()=>e.length?e.map(c=>bh(c)?n:new Wl(t(c),c)):iu)}const i=Fa({callback:a});return wr(()=>{i==null||i.disconnect(),a(),e.forEach(c=>i==null?void 0:i.observe(c))},[e]),s}function Th(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return vo(t)?t:e}function Xy(e){let{measure:t}=e;const[r,n]=g.useState(null),s=g.useCallback(u=>{for(const{target:d}of u)if(vo(d)){n(f=>{const m=t(d);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),o=Fa({callback:s}),a=g.useCallback(u=>{const d=Th(u);o==null||o.disconnect(),d&&(o==null||o.observe(d)),n(d?t(d):null)},[t,o]),[i,c]=ha(a);return g.useMemo(()=>({nodeRef:i,rect:r,setRef:c}),[r,i,c])}const Jy=[{sensor:Pa,options:{}},{sensor:Gl,options:{}}],eb={current:{}},Go={draggable:{measure:Jc},droppable:{measure:Jc,strategy:ro.WhileDragging,frequency:cl.Optimized},dragOverlay:{measure:Ts}};class Gs extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const tb={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Gs,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ga},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Go,measureDroppableContainers:ga,windowRect:null,measuringScheduled:!1},Eh={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ga,draggableNodes:new Map,over:null,measureDroppableContainers:ga},Co=g.createContext(Eh),kh=g.createContext(tb);function rb(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Gs}}}function nb(e,t){switch(t.type){case pt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case pt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case pt.DragEnd:case pt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case pt.RegisterDroppable:{const{element:r}=t,{id:n}=r,s=new Gs(e.droppable.containers);return s.set(n,r),{...e,droppable:{...e.droppable,containers:s}}}case pt.SetDroppableDisabled:{const{id:r,key:n,disabled:s}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new Gs(e.droppable.containers);return a.set(r,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case pt.UnregisterDroppable:{const{id:r,key:n}=t,s=e.droppable.containers.get(r);if(!s||n!==s.key)return e;const o=new Gs(e.droppable.containers);return o.delete(r),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function sb(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:s}=g.useContext(Co),o=pa(n),a=pa(r==null?void 0:r.id);return g.useEffect(()=>{if(!t&&!n&&o&&a!=null){if(!Na(o)||document.activeElement===o.target)return;const i=s.get(a);if(!i)return;const{activatorNode:c,node:u}=i;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=ty(d);if(f){f.focus();break}}})}},[n,t,s,a,o]),null}function Ah(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...n}),r):r}function ob(e){return g.useMemo(()=>({draggable:{...Go.draggable,...e==null?void 0:e.draggable},droppable:{...Go.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Go.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function ab(e){let{activeNode:t,measure:r,initialRect:n,config:s=!0}=e;const o=g.useRef(!1),{x:a,y:i}=typeof s=="boolean"?{x:s,y:s}:s;wr(()=>{if(!a&&!i||!t){o.current=!1;return}if(o.current||!n)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=r(u),f=ph(d,n);if(a||(f.x=0),i||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const m=gh(u);m&&m.scrollBy({top:f.y,left:f.x})}},[t,a,i,n,r])}const Ma=g.createContext({...Tr,scaleX:1,scaleY:1});var an;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(an||(an={}));const ul=g.memo(function(t){var r,n,s,o;let{id:a,accessibility:i,autoScroll:c=!0,children:u,sensors:d=Jy,collisionDetection:f=my,measuring:m,modifiers:h,...b}=t;const p=g.useReducer(nb,void 0,rb),[v,y]=p,[C,S]=iy(),[x,_]=g.useState(an.Uninitialized),w=x===an.Initialized,{draggable:{active:E,nodes:k,translate:N},droppable:{containers:F}}=v,I=E!=null?k.get(E):null,R=g.useRef({initial:null,translated:null}),P=g.useMemo(()=>{var ct;return E!=null?{id:E,data:(ct=I==null?void 0:I.data)!=null?ct:eb,rect:R}:null},[E,I]),O=g.useRef(null),[V,ne]=g.useState(null),[W,ue]=g.useState(null),ie=eo(b,Object.values(b)),ve=bo("DndDescribedBy",a),me=g.useMemo(()=>F.getEnabled(),[F]),H=ob(m),{droppableRects:be,measureDroppableContainers:Te,measuringScheduled:$}=Uy(me,{dragging:w,dependencies:[N.x,N.y],config:H.droppable}),B=qy(k,E),le=g.useMemo(()=>W?ma(W):null,[W]),ge=Ar(),J=Vy(B,H.draggable.measure);ab({activeNode:E!=null?k.get(E):null,config:ge.layoutShiftCompensation,initialRect:J,measure:H.draggable.measure});const de=su(B,H.draggable.measure,J),X=su(B?B.parentElement:null),Ce=g.useRef({activatorEvent:null,active:null,activeNode:B,collisionRect:null,collisions:null,droppableRects:be,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ne=F.getNodeFor((r=Ce.current.over)==null?void 0:r.id),re=Xy({measure:H.dragOverlay.measure}),ce=(n=re.nodeRef.current)!=null?n:B,G=w?(s=re.rect)!=null?s:de:null,U=!!(re.nodeRef.current&&re.rect),Ee=Qy(U?null:de),we=wh(ce?Ht(ce):null),ke=Wy(w?Ne??B:null),xe=Zy(ke),Pe=Ah(h,{transform:{x:N.x-Ee.x,y:N.y-Ee.y,scaleX:1,scaleY:1},activatorEvent:W,active:P,activeNodeRect:de,containerNodeRect:X,draggingNodeRect:G,over:Ce.current.over,overlayNodeRect:re.rect,scrollableAncestors:ke,scrollableAncestorRects:xe,windowRect:we}),qt=le?ns(le,N):null,lr=Gy(ke),$t=au(lr),Lt=au(lr,[de]),T=ns(Pe,$t),D=G?yy(G,Pe):null,j=P&&D?f({active:P,collisionRect:D,droppableRects:be,droppableContainers:me,pointerCoordinates:qt}):null,z=hh(j,"id"),[Q,K]=g.useState(null),Y=U?Pe:ns(Pe,Lt),he=gy(Y,(o=Q==null?void 0:Q.rect)!=null?o:null,de),De=g.useRef(null),Ze=g.useCallback((ct,vt)=>{let{sensor:yt,options:zt}=vt;if(O.current==null)return;const Ut=k.get(O.current);if(!Ut)return;const Dt=ct.nativeEvent,Jt=new yt({active:O.current,activeNode:Ut,event:Dt,options:zt,context:Ce,onAbort(ut){if(!k.get(ut))return;const{onDragAbort:er}=ie.current,cr={id:ut};er==null||er(cr),C({type:"onDragAbort",event:cr})},onPending(ut,yr,er,cr){if(!k.get(ut))return;const{onDragPending:Xr}=ie.current,q={id:ut,constraint:yr,initialCoordinates:er,offset:cr};Xr==null||Xr(q),C({type:"onDragPending",event:q})},onStart(ut){const yr=O.current;if(yr==null)return;const er=k.get(yr);if(!er)return;const{onDragStart:cr}=ie.current,Zr={activatorEvent:Dt,active:{id:yr,data:er.data,rect:R}};Hr.unstable_batchedUpdates(()=>{cr==null||cr(Zr),_(an.Initializing),y({type:pt.DragStart,initialCoordinates:ut,active:yr}),C({type:"onDragStart",event:Zr}),ne(De.current),ue(Dt)})},onMove(ut){y({type:pt.DragMove,coordinates:ut})},onEnd:Br(pt.DragEnd),onCancel:Br(pt.DragCancel)});De.current=Jt;function Br(ut){return async function(){const{active:er,collisions:cr,over:Zr,scrollAdjustedTranslate:Xr}=Ce.current;let q=null;if(er&&Xr){const{cancelDrop:ye}=ie.current;q={activatorEvent:Dt,active:er,collisions:cr,delta:Xr,over:Zr},ut===pt.DragEnd&&typeof ye=="function"&&await Promise.resolve(ye(q))&&(ut=pt.DragCancel)}O.current=null,Hr.unstable_batchedUpdates(()=>{y({type:ut}),_(an.Uninitialized),K(null),ne(null),ue(null),De.current=null;const ye=ut===pt.DragEnd?"onDragEnd":"onDragCancel";if(q){const Ae=ie.current[ye];Ae==null||Ae(q),C({type:ye,event:q})}})}}},[k]),It=g.useCallback((ct,vt)=>(yt,zt)=>{const Ut=yt.nativeEvent,Dt=k.get(zt);if(O.current!==null||!Dt||Ut.dndKit||Ut.defaultPrevented)return;const Jt={active:Dt};ct(yt,vt.options,Jt)===!0&&(Ut.dndKit={capturedBy:vt.sensor},O.current=zt,Ze(yt,vt))},[k,Ze]),gt=$y(d,It);Ky(d),wr(()=>{de&&x===an.Initializing&&_(an.Initialized)},[de,x]),g.useEffect(()=>{const{onDragMove:ct}=ie.current,{active:vt,activatorEvent:yt,collisions:zt,over:Ut}=Ce.current;if(!vt||!yt)return;const Dt={active:vt,activatorEvent:yt,collisions:zt,delta:{x:T.x,y:T.y},over:Ut};Hr.unstable_batchedUpdates(()=>{ct==null||ct(Dt),C({type:"onDragMove",event:Dt})})},[T.x,T.y]),g.useEffect(()=>{const{active:ct,activatorEvent:vt,collisions:yt,droppableContainers:zt,scrollAdjustedTranslate:Ut}=Ce.current;if(!ct||O.current==null||!vt||!Ut)return;const{onDragOver:Dt}=ie.current,Jt=zt.get(z),Br=Jt&&Jt.rect.current?{id:Jt.id,rect:Jt.rect.current,data:Jt.data,disabled:Jt.disabled}:null,ut={active:ct,activatorEvent:vt,collisions:yt,delta:{x:Ut.x,y:Ut.y},over:Br};Hr.unstable_batchedUpdates(()=>{K(Br),Dt==null||Dt(ut),C({type:"onDragOver",event:ut})})},[z]),wr(()=>{Ce.current={activatorEvent:W,active:P,activeNode:B,collisionRect:D,collisions:j,droppableRects:be,draggableNodes:k,draggingNode:ce,draggingNodeRect:G,droppableContainers:F,over:Q,scrollableAncestors:ke,scrollAdjustedTranslate:T},R.current={initial:G,translated:D}},[P,B,j,D,k,ce,G,be,F,Q,ke,T]),Fy({...ge,delta:N,draggingRect:D,pointerCoordinates:qt,scrollableAncestors:ke,scrollableAncestorRects:xe});const lt=g.useMemo(()=>({active:P,activeNode:B,activeNodeRect:de,activatorEvent:W,collisions:j,containerNodeRect:X,dragOverlay:re,draggableNodes:k,droppableContainers:F,droppableRects:be,over:Q,measureDroppableContainers:Te,scrollableAncestors:ke,scrollableAncestorRects:xe,measuringConfiguration:H,measuringScheduled:$,windowRect:we}),[P,B,de,W,j,X,re,k,F,be,Q,Te,ke,xe,H,$,we]),Yr=g.useMemo(()=>({activatorEvent:W,activators:gt,active:P,activeNodeRect:de,ariaDescribedById:{draggable:ve},dispatch:y,draggableNodes:k,over:Q,measureDroppableContainers:Te}),[W,gt,P,de,y,ve,k,Q,Te]);return g.createElement(ch.Provider,{value:S},g.createElement(Co.Provider,{value:Yr},g.createElement(kh.Provider,{value:lt},g.createElement(Ma.Provider,{value:he},u)),g.createElement(sb,{disabled:(i==null?void 0:i.restoreFocus)===!1})),g.createElement(uy,{...i,hiddenTextDescribedById:ve}));function Ar(){const ct=(V==null?void 0:V.autoScrollEnabled)===!1,vt=typeof c=="object"?c.enabled===!1:c===!1,yt=w&&!ct&&!vt;return typeof c=="object"?{...c,enabled:yt}:{enabled:yt}}}),ib=g.createContext(null),lu="button",lb="Draggable";function Lh(e){let{id:t,data:r,disabled:n=!1,attributes:s}=e;const o=bo(lb),{activators:a,activatorEvent:i,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:m}=g.useContext(Co),{role:h=lu,roleDescription:b="draggable",tabIndex:p=0}=s??{},v=(c==null?void 0:c.id)===t,y=g.useContext(v?Ma:ib),[C,S]=ha(),[x,_]=ha(),w=Yy(a,t),E=eo(r);wr(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:x,data:E}),()=>{const N=f.get(t);N&&N.key===o&&f.delete(t)}),[f,t]);const k=g.useMemo(()=>({role:h,tabIndex:p,"aria-disabled":n,"aria-pressed":v&&h===lu?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,h,p,v,b,d.draggable]);return{active:c,activatorEvent:i,activeNodeRect:u,attributes:k,isDragging:v,listeners:n?void 0:w,node:C,over:m,setNodeRef:S,setActivatorNodeRef:_,transform:y}}function Ih(){return g.useContext(kh)}const cb="Droppable",ub={timeout:25};function db(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:s}=e;const o=bo(cb),{active:a,dispatch:i,over:c,measureDroppableContainers:u}=g.useContext(Co),d=g.useRef({disabled:r}),f=g.useRef(!1),m=g.useRef(null),h=g.useRef(null),{disabled:b,updateMeasurementsFor:p,timeout:v}={...ub,...s},y=eo(p??n),C=g.useCallback(()=>{if(!f.current){f.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),h.current=null},v)},[v]),S=Fa({callback:C,disabled:b||!a}),x=g.useCallback((k,N)=>{S&&(N&&(S.unobserve(N),f.current=!1),k&&S.observe(k))},[S]),[_,w]=ha(x),E=eo(t);return g.useEffect(()=>{!S||!_.current||(S.disconnect(),f.current=!1,S.observe(_.current))},[_,S]),g.useEffect(()=>(i({type:pt.RegisterDroppable,element:{id:n,key:o,disabled:r,node:_,rect:m,data:E}}),()=>i({type:pt.UnregisterDroppable,key:o,id:n})),[n]),g.useEffect(()=>{r!==d.current.disabled&&(i({type:pt.SetDroppableDisabled,id:n,key:o,disabled:r}),d.current.disabled=r)},[n,o,r,i]),{active:a,rect:m,isOver:(c==null?void 0:c.id)===n,node:_,over:c,setNodeRef:w}}function fb(e){let{animation:t,children:r}=e;const[n,s]=g.useState(null),[o,a]=g.useState(null),i=pa(r);return!r&&!n&&i&&s(i),wr(()=>{if(!o)return;const c=n==null?void 0:n.key,u=n==null?void 0:n.props.id;if(c==null||u==null){s(null);return}Promise.resolve(t(u,o)).then(()=>{s(null)})},[t,n,o]),g.createElement(g.Fragment,null,r,n?g.cloneElement(n,{ref:a}):null)}const hb={x:0,y:0,scaleX:1,scaleY:1};function pb(e){let{children:t}=e;return g.createElement(Co.Provider,{value:Eh},g.createElement(Ma.Provider,{value:hb},t))}const mb={position:"fixed",touchAction:"none"},gb=e=>Na(e)?"transform 250ms ease":void 0,vb=g.forwardRef((e,t)=>{let{as:r,activatorEvent:n,adjustScale:s,children:o,className:a,rect:i,style:c,transform:u,transition:d=gb}=e;if(!i)return null;const f=s?u:{...u,scaleX:1,scaleY:1},m={...mb,width:i.width,height:i.height,top:i.top,left:i.left,transform:Wr.Transform.toString(f),transformOrigin:s&&n?dy(n,i):void 0,transition:typeof d=="function"?d(n):d,...c};return g.createElement(r,{className:a,style:m,ref:t},o)}),yb=e=>t=>{let{active:r,dragOverlay:n}=t;const s={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[i,c]of Object.entries(o.active))c!==void 0&&(s[i]=r.node.style.getPropertyValue(i),r.node.style.setProperty(i,c));if(o!=null&&o.dragOverlay)for(const[i,c]of Object.entries(o.dragOverlay))c!==void 0&&n.node.style.setProperty(i,c);return a!=null&&a.active&&r.node.classList.add(a.active),a!=null&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const[c,u]of Object.entries(s))r.node.style.setProperty(c,u);a!=null&&a.active&&r.node.classList.remove(a.active)}},bb=e=>{let{transform:{initial:t,final:r}}=e;return[{transform:Wr.Transform.toString(t)},{transform:Wr.Transform.toString(r)}]},Cb={duration:250,easing:"ease",keyframes:bb,sideEffects:yb({styles:{active:{opacity:"0"}}})};function Sb(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:s}=e;return Oa((o,a)=>{if(t===null)return;const i=r.get(o);if(!i)return;const c=i.node.current;if(!c)return;const u=Th(a);if(!u)return;const{transform:d}=Ht(a).getComputedStyle(a),f=mh(d);if(!f)return;const m=typeof t=="function"?t:xb(t);return xh(c,s.draggable.measure),m({active:{id:o,data:i.data,node:c,rect:s.draggable.measure(c)},draggableNodes:r,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:n,measuringConfiguration:s,transform:f})})}function xb(e){const{duration:t,easing:r,sideEffects:n,keyframes:s}={...Cb,...e};return o=>{let{active:a,dragOverlay:i,transform:c,...u}=o;if(!t)return;const d={x:i.rect.left-a.rect.left,y:i.rect.top-a.rect.top},f={scaleX:c.scaleX!==1?a.rect.width*c.scaleX/i.rect.width:1,scaleY:c.scaleY!==1?a.rect.height*c.scaleY/i.rect.height:1},m={x:c.x-d.x,y:c.y-d.y,...f},h=s({...u,active:a,dragOverlay:i,transform:{initial:c,final:m}}),[b]=h,p=h[h.length-1];if(JSON.stringify(b)===JSON.stringify(p))return;const v=n==null?void 0:n({active:a,dragOverlay:i,...u}),y=i.node.animate(h,{duration:t,easing:r,fill:"forwards"});return new Promise(C=>{y.onfinish=()=>{v==null||v(),C()}})}}let cu=0;function _b(e){return g.useMemo(()=>{if(e!=null)return cu++,cu},[e])}const wb=g.memo(e=>{let{adjustScale:t=!1,children:r,dropAnimation:n,style:s,transition:o,modifiers:a,wrapperElement:i="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:h,draggableNodes:b,droppableContainers:p,dragOverlay:v,over:y,measuringConfiguration:C,scrollableAncestors:S,scrollableAncestorRects:x,windowRect:_}=Ih(),w=g.useContext(Ma),E=_b(f==null?void 0:f.id),k=Ah(a,{activatorEvent:d,active:f,activeNodeRect:m,containerNodeRect:h,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:S,scrollableAncestorRects:x,transform:w,windowRect:_}),N=Yl(m),F=Sb({config:n,draggableNodes:b,droppableContainers:p,measuringConfiguration:C}),I=N?v.setRef:void 0;return g.createElement(pb,null,g.createElement(fb,{animation:F},f&&E?g.createElement(vb,{key:E,id:f.id,ref:I,as:i,activatorEvent:d,adjustScale:t,className:c,transition:o,rect:N,style:{zIndex:u,...s},transform:k},r):null))});/**
182
182
  * @license lucide-react v0.400.0 - ISC
183
183
  *
184
184
  * This source code is licensed under the ISC license.
185
185
  * See the LICENSE file in the root directory of this source tree.
186
- */const vy=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Pf=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
186
+ */const Tb=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Dh=(...e)=>e.filter((t,r,n)=>!!t&&n.indexOf(t)===r).join(" ");/**
187
187
  * @license lucide-react v0.400.0 - ISC
188
188
  *
189
189
  * This source code is licensed under the ISC license.
190
190
  * See the LICENSE file in the root directory of this source tree.
191
- */var yy={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
191
+ */var Eb={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
192
192
  * @license lucide-react v0.400.0 - ISC
193
193
  *
194
194
  * This source code is licensed under the ISC license.
195
195
  * See the LICENSE file in the root directory of this source tree.
196
- */const by=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},c)=>g.createElement("svg",{ref:c,...yy,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Pf("lucide",s),...a},[...o.map(([u,d])=>g.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
196
+ */const kb=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:a,...i},c)=>g.createElement("svg",{ref:c,...Eb,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Dh("lucide",s),...i},[...a.map(([u,d])=>g.createElement(u,d)),...Array.isArray(o)?o:[o]]));/**
197
197
  * @license lucide-react v0.400.0 - ISC
198
198
  *
199
199
  * This source code is licensed under the ISC license.
200
200
  * See the LICENSE file in the root directory of this source tree.
201
- */const ie=(e,t)=>{const r=g.forwardRef(({className:n,...s},i)=>g.createElement(by,{ref:i,iconNode:t,className:Pf(`lucide-${vy(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
201
+ */const pe=(e,t)=>{const r=g.forwardRef(({className:n,...s},o)=>g.createElement(kb,{ref:o,iconNode:t,className:Dh(`lucide-${Tb(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
202
202
  * @license lucide-react v0.400.0 - ISC
203
203
  *
204
204
  * This source code is licensed under the ISC license.
205
205
  * See the LICENSE file in the root directory of this source tree.
206
- */const Cy=ie("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
206
+ */const Ab=pe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
207
207
  * @license lucide-react v0.400.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
- */const wl=ie("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
211
+ */const Zl=pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
212
212
  * @license lucide-react v0.400.0 - ISC
213
213
  *
214
214
  * This source code is licensed under the ISC license.
215
215
  * See the LICENSE file in the root directory of this source tree.
216
- */const Sy=ie("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
216
+ */const Lb=pe("ArrowUpAZ",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]]);/**
217
217
  * @license lucide-react v0.400.0 - ISC
218
218
  *
219
219
  * This source code is licensed under the ISC license.
220
220
  * See the LICENSE file in the root directory of this source tree.
221
- */const _y=ie("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
221
+ */const Ib=pe("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
222
222
  * @license lucide-react v0.400.0 - ISC
223
223
  *
224
224
  * This source code is licensed under the ISC license.
225
225
  * See the LICENSE file in the root directory of this source tree.
226
- */const Qr=ie("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
226
+ */const Fr=pe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);/**
227
227
  * @license lucide-react v0.400.0 - ISC
228
228
  *
229
229
  * This source code is licensed under the ISC license.
230
230
  * See the LICENSE file in the root directory of this source tree.
231
- */const wy=ie("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
231
+ */const Db=pe("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/**
232
232
  * @license lucide-react v0.400.0 - ISC
233
233
  *
234
234
  * This source code is licensed under the ISC license.
235
235
  * See the LICENSE file in the root directory of this source tree.
236
- */const bn=ie("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
236
+ */const Es=pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
237
237
  * @license lucide-react v0.400.0 - ISC
238
238
  *
239
239
  * This source code is licensed under the ISC license.
240
240
  * See the LICENSE file in the root directory of this source tree.
241
- */const Cn=ie("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
241
+ */const bn=pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
242
242
  * @license lucide-react v0.400.0 - ISC
243
243
  *
244
244
  * This source code is licensed under the ISC license.
245
245
  * See the LICENSE file in the root directory of this source tree.
246
- */const xl=ie("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
246
+ */const Ba=pe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
247
247
  * @license lucide-react v0.400.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
- */const xy=ie("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
251
+ */const jb=pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
252
252
  * @license lucide-react v0.400.0 - ISC
253
253
  *
254
254
  * This source code is licensed under the ISC license.
255
255
  * See the LICENSE file in the root directory of this source tree.
256
- */const Rf=ie("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
256
+ */const jh=pe("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
257
257
  * @license lucide-react v0.400.0 - ISC
258
258
  *
259
259
  * This source code is licensed under the ISC license.
260
260
  * See the LICENSE file in the root directory of this source tree.
261
- */const vo=ie("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
261
+ */const qa=pe("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
262
262
  * @license lucide-react v0.400.0 - ISC
263
263
  *
264
264
  * This source code is licensed under the ISC license.
265
265
  * See the LICENSE file in the root directory of this source tree.
266
- */const Ty=ie("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
266
+ */const Ob=pe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
267
267
  * @license lucide-react v0.400.0 - ISC
268
268
  *
269
269
  * This source code is licensed under the ISC license.
270
270
  * See the LICENSE file in the root directory of this source tree.
271
- */const Ey=ie("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
271
+ */const Nb=pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
272
272
  * @license lucide-react v0.400.0 - ISC
273
273
  *
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
- */const Ay=ie("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
276
+ */const Rb=pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
277
277
  * @license lucide-react v0.400.0 - ISC
278
278
  *
279
279
  * This source code is licensed under the ISC license.
280
280
  * See the LICENSE file in the root directory of this source tree.
281
- */const Ff=ie("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
281
+ */const Oh=pe("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
282
282
  * @license lucide-react v0.400.0 - ISC
283
283
  *
284
284
  * This source code is licensed under the ISC license.
285
285
  * See the LICENSE file in the root directory of this source tree.
286
- */const ky=ie("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
286
+ */const Pb=pe("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
287
287
  * @license lucide-react v0.400.0 - ISC
288
288
  *
289
289
  * This source code is licensed under the ISC license.
290
290
  * See the LICENSE file in the root directory of this source tree.
291
- */const Js=ie("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
291
+ */const So=pe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
292
292
  * @license lucide-react v0.400.0 - ISC
293
293
  *
294
294
  * This source code is licensed under the ISC license.
295
295
  * See the LICENSE file in the root directory of this source tree.
296
- */const Wr=ie("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
296
+ */const Cn=pe("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/**
297
297
  * @license lucide-react v0.400.0 - ISC
298
298
  *
299
299
  * This source code is licensed under the ISC license.
300
300
  * See the LICENSE file in the root directory of this source tree.
301
- */const Ec=ie("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
301
+ */const uu=pe("Flag",[["path",{d:"M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z",key:"i9b6wo"}],["line",{x1:"4",x2:"4",y1:"22",y2:"15",key:"1cm3nv"}]]);/**
302
302
  * @license lucide-react v0.400.0 - ISC
303
303
  *
304
304
  * This source code is licensed under the ISC license.
305
305
  * See the LICENSE file in the root directory of this source tree.
306
- */const Iy=ie("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
306
+ */const Fb=pe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
307
307
  * @license lucide-react v0.400.0 - ISC
308
308
  *
309
309
  * This source code is licensed under the ISC license.
310
310
  * See the LICENSE file in the root directory of this source tree.
311
- */const Mf=ie("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
311
+ */const Nh=pe("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
312
312
  * @license lucide-react v0.400.0 - ISC
313
313
  *
314
314
  * This source code is licensed under the ISC license.
315
315
  * See the LICENSE file in the root directory of this source tree.
316
- */const Bf=ie("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
316
+ */const Rh=pe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
317
317
  * @license lucide-react v0.400.0 - ISC
318
318
  *
319
319
  * This source code is licensed under the ISC license.
320
320
  * See the LICENSE file in the root directory of this source tree.
321
- */const Dy=ie("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
321
+ */const Mb=pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
322
322
  * @license lucide-react v0.400.0 - ISC
323
323
  *
324
324
  * This source code is licensed under the ISC license.
325
325
  * See the LICENSE file in the root directory of this source tree.
326
- */const qf=ie("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
326
+ */const Xl=pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
327
327
  * @license lucide-react v0.400.0 - ISC
328
328
  *
329
329
  * This source code is licensed under the ISC license.
330
330
  * See the LICENSE file in the root directory of this source tree.
331
- */const Ly=ie("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
331
+ */const Bb=pe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
332
332
  * @license lucide-react v0.400.0 - ISC
333
333
  *
334
334
  * This source code is licensed under the ISC license.
335
335
  * See the LICENSE file in the root directory of this source tree.
336
- */const $f=ie("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
336
+ */const Ph=pe("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
337
337
  * @license lucide-react v0.400.0 - ISC
338
338
  *
339
339
  * This source code is licensed under the ISC license.
340
340
  * See the LICENSE file in the root directory of this source tree.
341
- */const Bn=ie("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
341
+ */const Vr=pe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
342
342
  * @license lucide-react v0.400.0 - ISC
343
343
  *
344
344
  * This source code is licensed under the ISC license.
345
345
  * See the LICENSE file in the root directory of this source tree.
346
- */const yo=ie("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
346
+ */const $a=pe("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
347
347
  * @license lucide-react v0.400.0 - ISC
348
348
  *
349
349
  * This source code is licensed under the ISC license.
350
350
  * See the LICENSE file in the root directory of this source tree.
351
- */const Oy=ie("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
351
+ */const qb=pe("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
352
352
  * @license lucide-react v0.400.0 - ISC
353
353
  *
354
354
  * This source code is licensed under the ISC license.
355
355
  * See the LICENSE file in the root directory of this source tree.
356
- */const ki=ie("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
356
+ */const Ko=pe("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
357
357
  * @license lucide-react v0.400.0 - ISC
358
358
  *
359
359
  * This source code is licensed under the ISC license.
360
360
  * See the LICENSE file in the root directory of this source tree.
361
- */const Uf=ie("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
361
+ */const Fh=pe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
362
362
  * @license lucide-react v0.400.0 - ISC
363
363
  *
364
364
  * This source code is licensed under the ISC license.
365
365
  * See the LICENSE file in the root directory of this source tree.
366
- */const Ny=ie("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
366
+ */const $b=pe("Milestone",[["path",{d:"M18 6H5a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h13l4-3.5L18 6Z",key:"1mp5s7"}],["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}]]);/**
367
367
  * @license lucide-react v0.400.0 - ISC
368
368
  *
369
369
  * This source code is licensed under the ISC license.
370
370
  * See the LICENSE file in the root directory of this source tree.
371
- */const bo=ie("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
371
+ */const Ua=pe("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
372
372
  * @license lucide-react v0.400.0 - ISC
373
373
  *
374
374
  * This source code is licensed under the ISC license.
375
375
  * See the LICENSE file in the root directory of this source tree.
376
- */const Co=ie("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
376
+ */const Va=pe("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
377
377
  * @license lucide-react v0.400.0 - ISC
378
378
  *
379
379
  * This source code is licensed under the ISC license.
380
380
  * See the LICENSE file in the root directory of this source tree.
381
- */const jy=ie("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
381
+ */const Ub=pe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
382
382
  * @license lucide-react v0.400.0 - ISC
383
383
  *
384
384
  * This source code is licensed under the ISC license.
385
385
  * See the LICENSE file in the root directory of this source tree.
386
- */const Py=ie("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
386
+ */const Vb=pe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
387
387
  * @license lucide-react v0.400.0 - ISC
388
388
  *
389
389
  * This source code is licensed under the ISC license.
390
390
  * See the LICENSE file in the root directory of this source tree.
391
- */const Ry=ie("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
391
+ */const Hb=pe("PanelRightClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]);/**
392
392
  * @license lucide-react v0.400.0 - ISC
393
393
  *
394
394
  * This source code is licensed under the ISC license.
395
395
  * See the LICENSE file in the root directory of this source tree.
396
- */const Fy=ie("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
396
+ */const zb=pe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
397
397
  * @license lucide-react v0.400.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
400
400
  * See the LICENSE file in the root directory of this source tree.
401
- */const Sn=ie("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
401
+ */const Gr=pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
402
402
  * @license lucide-react v0.400.0 - ISC
403
403
  *
404
404
  * This source code is licensed under the ISC license.
405
405
  * See the LICENSE file in the root directory of this source tree.
406
- */const Ac=ie("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
406
+ */const du=pe("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
407
407
  * @license lucide-react v0.400.0 - ISC
408
408
  *
409
409
  * This source code is licensed under the ISC license.
410
410
  * See the LICENSE file in the root directory of this source tree.
411
- */const kc=ie("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
411
+ */const fu=pe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
412
412
  * @license lucide-react v0.400.0 - ISC
413
413
  *
414
414
  * This source code is licensed under the ISC license.
415
415
  * See the LICENSE file in the root directory of this source tree.
416
- */const My=ie("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
416
+ */const Qb=pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
417
417
  * @license lucide-react v0.400.0 - ISC
418
418
  *
419
419
  * This source code is licensed under the ISC license.
420
420
  * See the LICENSE file in the root directory of this source tree.
421
- */const By=ie("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
421
+ */const Wb=pe("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/**
422
422
  * @license lucide-react v0.400.0 - ISC
423
423
  *
424
424
  * This source code is licensed under the ISC license.
425
425
  * See the LICENSE file in the root directory of this source tree.
426
- */const qy=ie("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
426
+ */const Gb=pe("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 4 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-8l4-2",key:"1vwozw"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 8-4 8 4",key:"1q0ilc"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/**
427
427
  * @license lucide-react v0.400.0 - ISC
428
428
  *
429
429
  * This source code is licensed under the ISC license.
430
430
  * See the LICENSE file in the root directory of this source tree.
431
- */const Yi=ie("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
431
+ */const ya=pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
432
432
  * @license lucide-react v0.400.0 - ISC
433
433
  *
434
434
  * This source code is licensed under the ISC license.
435
435
  * See the LICENSE file in the root directory of this source tree.
436
- */const $y=ie("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
436
+ */const Kb=pe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
437
437
  * @license lucide-react v0.400.0 - ISC
438
438
  *
439
439
  * This source code is licensed under the ISC license.
440
440
  * See the LICENSE file in the root directory of this source tree.
441
- */const Uy=ie("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
441
+ */const Yb=pe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
442
442
  * @license lucide-react v0.400.0 - ISC
443
443
  *
444
444
  * This source code is licensed under the ISC license.
445
445
  * See the LICENSE file in the root directory of this source tree.
446
- */const zy=ie("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
446
+ */const Zb=pe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
447
447
  * @license lucide-react v0.400.0 - ISC
448
448
  *
449
449
  * This source code is licensed under the ISC license.
450
450
  * See the LICENSE file in the root directory of this source tree.
451
- */const Vy=ie("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
451
+ */const Xb=pe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
452
452
  * @license lucide-react v0.400.0 - ISC
453
453
  *
454
454
  * This source code is licensed under the ISC license.
455
455
  * See the LICENSE file in the root directory of this source tree.
456
- */const Hy=ie("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
456
+ */const Jb=pe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
457
457
  * @license lucide-react v0.400.0 - ISC
458
458
  *
459
459
  * This source code is licensed under the ISC license.
460
460
  * See the LICENSE file in the root directory of this source tree.
461
- */const So=ie("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
461
+ */const ks=pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
462
462
  * @license lucide-react v0.400.0 - ISC
463
463
  *
464
464
  * This source code is licensed under the ISC license.
465
465
  * See the LICENSE file in the root directory of this source tree.
466
- */const Qy=ie("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
466
+ */const eC=pe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
467
467
  * @license lucide-react v0.400.0 - ISC
468
468
  *
469
469
  * This source code is licensed under the ISC license.
470
470
  * See the LICENSE file in the root directory of this source tree.
471
- */const Ma=ie("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
471
+ */const dl=pe("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
472
472
  * @license lucide-react v0.400.0 - ISC
473
473
  *
474
474
  * This source code is licensed under the ISC license.
475
475
  * See the LICENSE file in the root directory of this source tree.
476
- */const Wy=ie("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
476
+ */const tC=pe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
477
477
  * @license lucide-react v0.400.0 - ISC
478
478
  *
479
479
  * This source code is licensed under the ISC license.
480
480
  * See the LICENSE file in the root directory of this source tree.
481
- */const Gy=ie("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
481
+ */const rC=pe("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
482
482
  * @license lucide-react v0.400.0 - ISC
483
483
  *
484
484
  * This source code is licensed under the ISC license.
485
485
  * See the LICENSE file in the root directory of this source tree.
486
- */const _o=ie("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
486
+ */const Ha=pe("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
487
487
  * @license lucide-react v0.400.0 - ISC
488
488
  *
489
489
  * This source code is licensed under the ISC license.
490
490
  * See the LICENSE file in the root directory of this source tree.
491
- */const br=ie("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
491
+ */const Mr=pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
492
492
  * @license lucide-react v0.400.0 - ISC
493
493
  *
494
494
  * This source code is licensed under the ISC license.
495
495
  * See the LICENSE file in the root directory of this source tree.
496
- */const Ky=ie("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Yy={},Ic=e=>{let t;const r=new Set,n=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const p=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,p))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(Yy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,s,c);return c},Zy=e=>e?Ic(e):Ic;function Tl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pi={exports:{}},$o={},mi={exports:{}},Uo={};/**
496
+ */const nC=pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),sC={},hu=e=>{let t;const r=new Set,n=(d,f)=>{const m=typeof d=="function"?d(t):d;if(!Object.is(m,t)){const h=t;t=f??(typeof m!="object"||m===null)?m:Object.assign({},t,m),r.forEach(b=>b(t,h))}},s=()=>t,c={setState:n,getState:s,getInitialState:()=>u,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(sC?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},u=t=e(n,s,c);return c},oC=e=>e?hu(e):hu;function Jl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ro={exports:{}},hi={},Po={exports:{}},pi={};/**
497
497
  * @license React
498
498
  * use-sync-external-store-shim.production.js
499
499
  *
@@ -501,7 +501,7 @@ to {
501
501
  *
502
502
  * This source code is licensed under the MIT license found in the
503
503
  * LICENSE file in the root directory of this source tree.
504
- */var Dc;function Xy(){if(Dc)return Uo;Dc=1;var e=g;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function a(f,m){var p=m(),b=n({inst:{value:p,getSnapshot:m}}),h=b[0].inst,v=b[1];return i(function(){h.value=p,h.getSnapshot=m,c(h)&&v({inst:h})},[f,p,m]),s(function(){return c(h)&&v({inst:h}),f(function(){c(h)&&v({inst:h})})},[f]),o(p),p}function c(f){var m=f.getSnapshot;f=f.value;try{var p=m();return!r(f,p)}catch{return!0}}function u(f,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Uo.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,Uo}var zo={};/**
504
+ */var pu;function aC(){if(pu)return pi;pu=1;var e=g;function t(f,m){return f===m&&(f!==0||1/f===1/m)||f!==f&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function i(f,m){var h=m(),b=n({inst:{value:h,getSnapshot:m}}),p=b[0].inst,v=b[1];return o(function(){p.value=h,p.getSnapshot=m,c(p)&&v({inst:p})},[f,h,m]),s(function(){return c(p)&&v({inst:p}),f(function(){c(p)&&v({inst:p})})},[f]),a(h),h}function c(f){var m=f.getSnapshot;f=f.value;try{var h=m();return!r(f,h)}catch{return!0}}function u(f,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:i;return pi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,pi}var mi={};/**
505
505
  * @license React
506
506
  * use-sync-external-store-shim.development.js
507
507
  *
@@ -509,7 +509,7 @@ to {
509
509
  *
510
510
  * This source code is licensed under the MIT license found in the
511
511
  * LICENSE file in the root directory of this source tree.
512
- */var Lc;function Jy(){return Lc||(Lc=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}function t(p,b){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var h=b();if(!f){var v=b();i(h,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=o({inst:{value:h,getSnapshot:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=h,y.getSnapshot=b,r(y)&&C({inst:y})},[p,h,b]),a(function(){return r(y)&&C({inst:y}),p(function(){r(y)&&C({inst:y})})},[p]),u(h),h}function r(p){var b=p.getSnapshot;p=p.value;try{var h=b();return!i(p,h)}catch{return!0}}function n(p,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=g,i=typeof Object.is=="function"?Object.is:e,o=s.useState,a=s.useEffect,c=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;zo.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),zo}var Oc;function El(){return Oc||(Oc=1,process.env.NODE_ENV==="production"?mi.exports=Xy():mi.exports=Jy()),mi.exports}/**
512
+ */var mu;function iC(){return mu||(mu=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,b){return h===b&&(h!==0||1/h===1/b)||h!==h&&b!==b}function t(h,b){d||s.startTransition===void 0||(d=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=b();if(!f){var v=b();o(p,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}v=a({inst:{value:p,getSnapshot:b}});var y=v[0].inst,C=v[1];return c(function(){y.value=p,y.getSnapshot=b,r(y)&&C({inst:y})},[h,p,b]),i(function(){return r(y)&&C({inst:y}),h(function(){r(y)&&C({inst:y})})},[h]),u(p),p}function r(h){var b=h.getSnapshot;h=h.value;try{var p=b();return!o(h,p)}catch{return!0}}function n(h,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=g,o=typeof Object.is=="function"?Object.is:e,a=s.useState,i=s.useEffect,c=s.useLayoutEffect,u=s.useDebugValue,d=!1,f=!1,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?n:t;mi.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),mi}var gu;function ec(){return gu||(gu=1,process.env.NODE_ENV==="production"?Po.exports=aC():Po.exports=iC()),Po.exports}/**
513
513
  * @license React
514
514
  * use-sync-external-store-shim/with-selector.production.js
515
515
  *
@@ -517,7 +517,7 @@ to {
517
517
  *
518
518
  * This source code is licensed under the MIT license found in the
519
519
  * LICENSE file in the root directory of this source tree.
520
- */var Nc;function eb(){if(Nc)return $o;Nc=1;var e=g,t=El();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,i=e.useRef,o=e.useEffect,a=e.useMemo,c=e.useDebugValue;return $o.useSyncExternalStoreWithSelector=function(u,d,f,m,p){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return _=D}return _=E}if(D=_,n(S,E))return D;var T=m(E);return p!==void 0&&p(D,T)?(S=E,D):(S=E,_=T)}var C=!1,S,_,x=f===void 0?null:f;return[function(){return y(d())},x===null?void 0:function(){return y(x())}]},[d,f,m,p]);var v=s(u,b[0],b[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},$o}var Vo={};/**
520
+ */var vu;function lC(){if(vu)return hi;vu=1;var e=g,t=ec();function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,s=t.useSyncExternalStore,o=e.useRef,a=e.useEffect,i=e.useMemo,c=e.useDebugValue;return hi.useSyncExternalStoreWithSelector=function(u,d,f,m,h){var b=o(null);if(b.current===null){var p={hasValue:!1,value:null};b.current=p}else p=b.current;b=i(function(){function y(w){if(!C){if(C=!0,S=w,w=m(w),h!==void 0&&p.hasValue){var E=p.value;if(h(E,w))return x=E}return x=w}if(E=x,n(S,w))return E;var k=m(w);return h!==void 0&&h(E,k)?(S=w,E):(S=w,x=k)}var C=!1,S,x,_=f===void 0?null:f;return[function(){return y(d())},_===null?void 0:function(){return y(_())}]},[d,f,m,h]);var v=s(u,b[0],b[1]);return a(function(){p.hasValue=!0,p.value=v},[v]),c(v),v},hi}var gi={};/**
521
521
  * @license React
522
522
  * use-sync-external-store-shim/with-selector.development.js
523
523
  *
@@ -525,22 +525,22 @@ to {
525
525
  *
526
526
  * This source code is licensed under the MIT license found in the
527
527
  * LICENSE file in the root directory of this source tree.
528
- */var jc;function tb(){return jc||(jc=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,r=El(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,i=t.useRef,o=t.useEffect,a=t.useMemo,c=t.useDebugValue;Vo.useSyncExternalStoreWithSelector=function(u,d,f,m,p){var b=i(null);if(b.current===null){var h={hasValue:!1,value:null};b.current=h}else h=b.current;b=a(function(){function y(E){if(!C){if(C=!0,S=E,E=m(E),p!==void 0&&h.hasValue){var D=h.value;if(p(D,E))return _=D}return _=E}if(D=_,n(S,E))return D;var T=m(E);return p!==void 0&&p(D,T)?(S=E,D):(S=E,_=T)}var C=!1,S,_,x=f===void 0?null:f;return[function(){return y(d())},x===null?void 0:function(){return y(x())}]},[d,f,m,p]);var v=s(u,b[0],b[1]);return o(function(){h.hasValue=!0,h.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Vo}var Pc;function rb(){return Pc||(Pc=1,process.env.NODE_ENV==="production"?pi.exports=eb():pi.exports=tb()),pi.exports}var nb=rb();const sb=Tl(nb),zf={},{useDebugValue:ib}=g,{useSyncExternalStoreWithSelector:ob}=sb;let Rc=!1;const ab=e=>e;function lb(e,t=ab,r){(zf?"production":void 0)!=="production"&&r&&!Rc&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Rc=!0);const n=ob(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return ib(n),n}const Fc=e=>{(zf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?Zy(e):e,r=(n,s)=>lb(t,n,s);return Object.assign(r,t),r},ei=e=>e?Fc(e):Fc,Al={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},cb={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}};function ub(e){return e.config.primaryCategory==="Learning Path"?cb:Al}const K=ei(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:Al,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=K.getState().formStatusMapper,n=[...t];for(;n.length>0;){const s=n.shift();if(r[s.id]===!1)return!1;s.children&&n.push(...s.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),db=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:K},Symbol.toStringTag,{value:"Module"})),yr=ei(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t})})),fb={emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},hb={ariaLabel:"Select language"},pb={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},mb={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},gb={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},vb={moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},yb={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},bb={removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},Cb={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},Sb={invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},_b={saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},wb={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab."},xb={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},Tb={dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},Eb={addPlaceholder:"Add…",addButtonLabel:"Add"},Ab={requiredError:"{field} is required"},kb={requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},Ib={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},Db={requiredError:"{field} is required",selectPlaceholder:"Select license…"},Lb={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Ob={requiredError:"{field} is required",selectPlaceholder:"Select…"},Nb={requiredError:"{field} is required"},jb={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options"},Pb={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},Rb={dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},Fb={dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},Mb={dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},Bb={title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},qb={publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",noButton:"No",yesButton:"Yes"},$b={reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},Ub={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},zb={contentTypeFiltersAriaLabel:"Content type filters"},Vb={alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added"},Hb={selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter"},Qb={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},Wb={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},Gb={maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},Kb={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},Yb={mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},Zb={title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},Xb={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},Jb={dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},eC={draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},tC={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},rC={closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},nC={closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},sC={remove:"Remove"},iC={dropHere:"Drop here"},oC={loading:"Loading"},aC={profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't a question-set-only course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills",skillsOutOfScopeWarning:"Out of scope, please re-select: {skills}",skillsUncoveredWarning:"No course covers these yet: {skills}",skillUncoveredPillTitle:"No linked course is tagged with this skill yet",searchSkillsPlaceholder:"Search skills",noSkillsAvailable:"No skills available yet",noMatchingSkills:"No matching skills",noSkillsSelectedYet:"No skills selected",removeSkillAriaLabel:"Remove {skill}",skillScopeFromPriorNote:"Pick which skills — from the Prior Assessment — this level builds. The Library filters courses to these skills.",skillScopeManualNote:"No Prior Assessment yet, so pick from the general skill catalog. The Library filters courses to these skills.",skillsCoveredHeading:"Skills covered",skillsCoveredDescription:"All skills tagged across this path's Prior Assessment, levels, and Outcome Assessment.",noSkillsYet:"No skills yet — add courses to see skills here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single course whose only content is a question set — no other content types belong here.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum selected",noCurriculumEmptyHint:"Select a Curriculum for this path to browse courses.",noSkillsEmptyTitle:"No skills selected",noSkillsEmptyHint:"Select skills for this level to see matching courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it."},Ba={contextualEditor:fb,languageSelector:hb,collectionEditor:pb,breadcrumb:mb,tabBar:gb,contentEditForm:vb,titleAppIcon:yb,unitContentList:bb,contentRow:Cb,csvUpload:Sb,manageCollaborators:_b,sparkMetaForm:wb,appIconField:xb,appIconPickerModal:Tb,chipGroupField:Eb,dateTimeField:Ab,dialcodeInputField:kb,keywordSuggestField:Ib,licenseSelectField:Db,multiSelectField:Lb,nestedSelectField:Ob,radioField:Nb,selectField:jb,textField:Pb,assetBrowser:Rb,resourceReorderDialog:Fb,assignPageNumber:Mb,confirmDialog:Bb,publishChecklist:qb,qualityParamsModal:$b,unsavedChangesModal:Ub,filterChips:zb,libraryCard:Vb,libraryDock:Hb,libraryFilterPanel:Qb,libraryPreviewPanel:Wb,outlineTree:Gb,treeNode:Kb,contentPlayer:Yb,dialcodePanel:Zb,progressStatus:Xb,splitBuilderShell:Jb,topbar:eC,reviewCommentModal:tC,confirmReviewModal:rC,generateQRModal:nC,chip:sC,dropZone:iC,spinner:oC,learningPath:aC},lC={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},cC={ariaLabel:"اختيار اللغة"},uC={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},dC={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},fC={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},hC={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},pC={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},mC={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},gC={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},vC={invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},yC={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},bC={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب."},CC={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},SC={dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},_C={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},wC={requiredError:"{field} مطلوب"},xC={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},TC={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},EC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},AC={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},kC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},IC={requiredError:"{field} مطلوب"},DC={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات"},LC={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},OC={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},NC={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},jC={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},PC={title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},RC={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",noButton:"لا",yesButton:"نعم"},FC={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},MC={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},BC={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},qC={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط"},$C={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا"},UC={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},zC={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},VC={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},HC={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},QC={mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},WC={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},GC={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},KC={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},YC={draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},ZC={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},XC={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},JC={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},eS={remove:"إزالة"},tS={dropHere:"أفلت هنا"},rS={loading:"جارٍ التحميل"},nS={profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقررًا يحتوي على بنك أسئلة فقط، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات",skillsOutOfScopeWarning:"خارج النطاق، يرجى إعادة الاختيار: {skills}",skillsUncoveredWarning:"لا يغطي أي مقرر هذه المهارات بعد: {skills}",skillUncoveredPillTitle:"لا يوجد مقرر مرتبط موسوم بهذه المهارة بعد",searchSkillsPlaceholder:"البحث عن المهارات",noSkillsAvailable:"لا توجد مهارات متاحة حتى الآن",noMatchingSkills:"لا توجد مهارات مطابقة",noSkillsSelectedYet:"لم يتم تحديد مهارات",removeSkillAriaLabel:"إزالة {skill}",skillScopeFromPriorNote:"اختر المهارات — من التقييم المسبق — التي يبنيها هذا المستوى. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillScopeManualNote:"لا يوجد تقييم مسبق حتى الآن، فاختر من كتالوج المهارات العام. تُصفّي المكتبة المقررات وفق هذه المهارات.",skillsCoveredHeading:"المهارات المشمولة",skillsCoveredDescription:"جميع المهارات الموسومة عبر التقييم المسبق والمستويات وتقييم النتائج لهذا المسار.",noSkillsYet:"لا توجد مهارات بعد — أضف مقررات لرؤية المهارات هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر واحد يكون محتواه الوحيد بنك أسئلة — لا تنتمي هنا أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج",noCurriculumEmptyHint:"حدد منهجًا لهذا المسار لتصفح المقررات.",noSkillsEmptyTitle:"لم يتم تحديد مهارات",noSkillsEmptyHint:"حدد مهارات لهذا المستوى لرؤية المقررات المطابقة.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق."},sS={contextualEditor:lC,languageSelector:cC,collectionEditor:uC,breadcrumb:dC,tabBar:fC,contentEditForm:hC,titleAppIcon:pC,unitContentList:mC,contentRow:gC,csvUpload:vC,manageCollaborators:yC,sparkMetaForm:bC,appIconField:CC,appIconPickerModal:SC,chipGroupField:_C,dateTimeField:wC,dialcodeInputField:xC,keywordSuggestField:TC,licenseSelectField:EC,multiSelectField:AC,nestedSelectField:kC,radioField:IC,selectField:DC,textField:LC,assetBrowser:OC,resourceReorderDialog:NC,assignPageNumber:jC,confirmDialog:PC,publishChecklist:RC,qualityParamsModal:FC,unsavedChangesModal:MC,filterChips:BC,libraryCard:qC,libraryDock:$C,libraryFilterPanel:UC,libraryPreviewPanel:zC,outlineTree:VC,treeNode:HC,contentPlayer:QC,dialcodePanel:WC,progressStatus:GC,splitBuilderShell:KC,topbar:YC,reviewCommentModal:ZC,confirmReviewModal:XC,generateQRModal:JC,chip:eS,dropZone:tS,spinner:rS,learningPath:nS},iS={emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},oS={ariaLabel:"Sélectionner la langue"},aS={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},lS={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},cS={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},uS={moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},dS={selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},fS={removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},hS={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},pS={invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},mS={saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},gS={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet."},vS={requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},yS={dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},bS={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},CS={requiredError:"{field} est requis"},SS={requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},_S={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},wS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},xS={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},TS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},ES={requiredError:"{field} est requis"},AS={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option"},kS={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},IS={dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},DS={dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},LS={dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},OS={title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},NS={publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",noButton:"Non",yesButton:"Oui"},jS={reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},PS={title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},RS={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},FS={alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté"},MS={selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre"},BS={boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},qS={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},$S={maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},US={expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},zS={mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},VS={title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},HS={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},QS={dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},WS={draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},GS={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},KS={closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},YS={closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},ZS={remove:"Supprimer"},XS={dropHere:"Déposer ici"},JS={loading:"Chargement"},e_={profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un cours composé uniquement d'un questionnaire, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences",skillsOutOfScopeWarning:"Hors du périmètre, veuillez resélectionner : {skills}",skillsUncoveredWarning:"Aucun cours ne couvre encore : {skills}",skillUncoveredPillTitle:"Aucun cours associé n'est encore étiqueté avec cette compétence",searchSkillsPlaceholder:"Rechercher des compétences",noSkillsAvailable:"Aucune compétence disponible pour le moment",noMatchingSkills:"Aucune compétence correspondante",noSkillsSelectedYet:"Aucune compétence sélectionnée",removeSkillAriaLabel:"Supprimer {skill}",skillScopeFromPriorNote:"Choisissez les compétences — issues de l'évaluation préalable — que ce niveau développe. La bibliothèque filtre les cours selon ces compétences.",skillScopeManualNote:"Aucune évaluation préalable pour le moment — choisissez dans le catalogue général des compétences. La bibliothèque filtre les cours selon ces compétences.",skillsCoveredHeading:"Compétences couvertes",skillsCoveredDescription:"Toutes les compétences associées à l'évaluation préalable, aux niveaux et à l'évaluation finale de ce parcours.",noSkillsYet:"Aucune compétence pour le moment — ajoutez des cours pour voir les compétences ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul cours dont le seul contenu est un questionnaire — aucun autre type de contenu n'a sa place ici.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) pour ce parcours afin de parcourir les cours.",noSkillsEmptyTitle:"Aucune compétence sélectionnée",noSkillsEmptyHint:"Sélectionnez des compétences pour ce niveau afin de voir les cours correspondants.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre."},t_={contextualEditor:iS,languageSelector:oS,collectionEditor:aS,breadcrumb:lS,tabBar:cS,contentEditForm:uS,titleAppIcon:dS,unitContentList:fS,contentRow:hS,csvUpload:pS,manageCollaborators:mS,sparkMetaForm:gS,appIconField:vS,appIconPickerModal:yS,chipGroupField:bS,dateTimeField:CS,dialcodeInputField:SS,keywordSuggestField:_S,licenseSelectField:wS,multiSelectField:xS,nestedSelectField:TS,radioField:ES,selectField:AS,textField:kS,assetBrowser:IS,resourceReorderDialog:DS,assignPageNumber:LS,confirmDialog:OS,publishChecklist:NS,qualityParamsModal:jS,unsavedChangesModal:PS,filterChips:RS,libraryCard:FS,libraryDock:MS,libraryFilterPanel:BS,libraryPreviewPanel:qS,outlineTree:$S,treeNode:US,contentPlayer:zS,dialcodePanel:VS,progressStatus:HS,splitBuilderShell:QS,topbar:WS,reviewCommentModal:GS,confirmReviewModal:KS,generateQRModal:YS,chip:ZS,dropZone:XS,spinner:JS,learningPath:e_},r_={emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},n_={ariaLabel:"Selecionar idioma"},s_={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},i_={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},o_={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},a_={moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},l_={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},c_={removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},u_={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},d_={invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},f_={saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},h_={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba."},p_={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},m_={dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},g_={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},v_={requiredError:"{field} é obrigatório"},y_={requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},b_={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},C_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},S_={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},__={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},w_={requiredError:"{field} é obrigatório"},x_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções"},T_={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},E_={dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},A_={dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},k_={dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},I_={title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},D_={publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",noButton:"Não",yesButton:"Sim"},L_={reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},O_={title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},N_={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},j_={alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado"},P_={selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente"},R_={boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},F_={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},M_={maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},B_={expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},q_={mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},$_={title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},U_={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},z_={dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},V_={draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},H_={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},Q_={closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},W_={closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},G_={remove:"Remover"},K_={dropHere:"Solte aqui"},Y_={loading:"Carregando"},Z_={profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um curso composto somente por um banco de questões, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades",skillsOutOfScopeWarning:"Fora do escopo, selecione novamente: {skills}",skillsUncoveredWarning:"Nenhum curso cobre ainda: {skills}",skillUncoveredPillTitle:"Nenhum curso vinculado está marcado com esta habilidade ainda",searchSkillsPlaceholder:"Buscar habilidades",noSkillsAvailable:"Nenhuma habilidade disponível ainda",noMatchingSkills:"Nenhuma habilidade correspondente",noSkillsSelectedYet:"Nenhuma habilidade selecionada",removeSkillAriaLabel:"Remover {skill}",skillScopeFromPriorNote:"Escolha quais habilidades — da Avaliação prévia — este nível desenvolve. A biblioteca filtra os cursos por essas habilidades.",skillScopeManualNote:"Ainda não há Avaliação prévia, então escolha no catálogo geral de habilidades. A biblioteca filtra os cursos por essas habilidades.",skillsCoveredHeading:"Habilidades abordadas",skillsCoveredDescription:"Todas as habilidades marcadas na Avaliação prévia, nos níveis e na Avaliação de resultado deste percurso.",noSkillsYet:"Nenhuma habilidade ainda — adicione cursos para ver as habilidades aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único curso cujo único conteúdo é um banco de questões — nenhum outro tipo de conteúdo pertence aqui.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum currículo selecionado",noCurriculumEmptyHint:"Selecione um currículo para esta trilha para navegar pelos cursos.",noSkillsEmptyTitle:"Nenhuma habilidade selecionada",noSkillsEmptyHint:"Selecione habilidades para este nível para ver os cursos correspondentes.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele."},X_={contextualEditor:r_,languageSelector:n_,collectionEditor:s_,breadcrumb:i_,tabBar:o_,contentEditForm:a_,titleAppIcon:l_,unitContentList:c_,contentRow:u_,csvUpload:d_,manageCollaborators:f_,sparkMetaForm:h_,appIconField:p_,appIconPickerModal:m_,chipGroupField:g_,dateTimeField:v_,dialcodeInputField:y_,keywordSuggestField:b_,licenseSelectField:C_,multiSelectField:S_,nestedSelectField:__,radioField:w_,selectField:x_,textField:T_,assetBrowser:E_,resourceReorderDialog:A_,assignPageNumber:k_,confirmDialog:I_,publishChecklist:D_,qualityParamsModal:L_,unsavedChangesModal:O_,filterChips:N_,libraryCard:j_,libraryDock:P_,libraryFilterPanel:R_,libraryPreviewPanel:F_,outlineTree:M_,treeNode:B_,contentPlayer:q_,dialcodePanel:$_,progressStatus:U_,splitBuilderShell:z_,topbar:V_,reviewCommentModal:H_,confirmReviewModal:Q_,generateQRModal:W_,chip:G_,dropZone:K_,spinner:Y_,learningPath:Z_},J_=["ar"],ew={en:Ba,ar:sS,fr:t_,pt:X_};function Vf(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],i=t[n];s&&i&&typeof s=="object"&&typeof i=="object"&&!Array.isArray(s)&&!Array.isArray(i)?r[n]=Vf(s,i):i!==void 0&&(r[n]=i)}return r}function Mc(e){const t=ew[e];return!t||e==="en"?Ba:Vf(Ba,t)}function tw(e){return J_.includes(e)}const qa="app-language",$a="app-language-change",kl=ei(e=>({lang:"en",labelConfig:Mc("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:Mc(t)}),localStorage.setItem(qa,t),document.documentElement.setAttribute("dir",tw(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent($a,{detail:{lang:t}}))}}));function Hf(e,t){return function(){return e.apply(t,arguments)}}const{toString:rw}=Object.prototype,{getPrototypeOf:es}=Object,{iterator:ti,toStringTag:Qf}=Symbol,Zi=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Fs=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),Zi(r,t))return!0;r=es(r)}return!1},nw=(e,t)=>e!=null&&Fs(e,t)?e[t]:void 0,Il=(e=>t=>{const r=rw.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ar=e=>(e=e.toLowerCase(),t=>Il(t)===e),wo=e=>t=>typeof t===e,{isArray:mn}=Array,ts=wo("undefined");function as(e){return e!==null&&!ts(e)&&e.constructor!==null&&!ts(e.constructor)&&Rt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Wf=ar("ArrayBuffer");function sw(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Wf(e.buffer),t}const iw=wo("string"),Rt=wo("function"),Gf=wo("number"),ls=e=>e!==null&&typeof e=="object",ow=e=>e===!0||e===!1,Ii=e=>{if(!ls(e))return!1;const t=es(e);return(t===null||t===Object.prototype||es(t)===null)&&!Fs(e,Qf)&&!Fs(e,ti)},aw=e=>{if(!ls(e)||as(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},lw=ar("Date"),cw=ar("File"),uw=e=>!!(e&&typeof e.uri<"u"),dw=e=>e&&typeof e.getParts<"u",fw=ar("Blob"),hw=ar("FileList"),pw=e=>ls(e)&&Rt(e.pipe);function mw(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Bc=mw(),qc=typeof Bc.FormData<"u"?Bc.FormData:void 0,gw=e=>{if(!e)return!1;if(qc&&e instanceof qc)return!0;const t=es(e);if(!t||t===Object.prototype||!Rt(e.append))return!1;const r=Il(e);return r==="formdata"||r==="object"&&Rt(e.toString)&&e.toString()==="[object FormData]"},vw=ar("URLSearchParams"),[yw,bw,Cw,Sw]=["ReadableStream","Request","Response","Headers"].map(ar),_w=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ri(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),mn(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(as(e))return;const i=r?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(n=0;n<o;n++)a=i[n],t.call(null,e[a],a,e)}}function Kf(e,t){if(as(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const en=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Yf=e=>!ts(e)&&e!==en;function Ua(...e){const{caseless:t,skipUndefined:r}=Yf(this)&&this||{},n={},s=(i,o)=>{if(o==="__proto__"||o==="constructor"||o==="prototype")return;const a=t&&typeof o=="string"&&Kf(n,o)||o,c=Zi(n,a)?n[a]:void 0;Ii(c)&&Ii(i)?n[a]=Ua(c,i):Ii(i)?n[a]=Ua({},i):mn(i)?n[a]=i.slice():(!r||!ts(i))&&(n[a]=i)};for(let i=0,o=e.length;i<o;i++){const a=e[i];if(!a||as(a)||(ri(a,s),typeof a!="object"||mn(a)))continue;const c=Object.getOwnPropertySymbols(a);for(let u=0;u<c.length;u++){const d=c[u];jw.call(a,d)&&s(a[d],d)}}return n}const ww=(e,t,r,{allOwnKeys:n}={})=>(ri(t,(s,i)=>{r&&Rt(s)?Object.defineProperty(e,i,{__proto__:null,value:Hf(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),xw=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tw=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Ew=(e,t,r,n)=>{let s,i,o;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!n||n(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=r!==!1&&es(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Aw=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},kw=e=>{if(!e)return null;if(mn(e))return e;let t=e.length;if(!Gf(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Iw=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&es(Uint8Array)),Dw=(e,t)=>{const n=(e&&e[ti]).call(e);let s;for(;(s=n.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Lw=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Ow=ar("HTMLFormElement"),Nw=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:jw}=Object.prototype,Pw=ar("RegExp"),Zf=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ri(r,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(n[i]=o||s)}),Object.defineProperties(e,n)},Rw=e=>{Zf(e,(t,r)=>{if(Rt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Rt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Fw=(e,t)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return mn(e)?n(e):n(String(e).split(t)),r},Mw=()=>{},Bw=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qw(e){return!!(e&&Rt(e.append)&&e[Qf]==="FormData"&&e[ti])}const $w=e=>{const t=new WeakSet,r=n=>{if(ls(n)){if(t.has(n))return;if(as(n))return n;if(!("toJSON"in n)){t.add(n);const s=mn(n)?[]:{};return ri(n,(i,o)=>{const a=r(i);!ts(a)&&(s[o]=a)}),t.delete(n),s}}return n};return r(e)},Uw=ar("AsyncFunction"),zw=e=>e&&(ls(e)||Rt(e))&&Rt(e.then)&&Rt(e.catch),Xf=((e,t)=>e?setImmediate:t?((r,n)=>(en.addEventListener("message",({source:s,data:i})=>{s===en&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),en.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Rt(en.postMessage)),Vw=typeof queueMicrotask<"u"?queueMicrotask.bind(en):typeof process<"u"&&process.nextTick||Xf,Jf=e=>e!=null&&Rt(e[ti]),Hw=e=>e!=null&&Fs(e,ti)&&Jf(e),L={isArray:mn,isArrayBuffer:Wf,isBuffer:as,isFormData:gw,isArrayBufferView:sw,isString:iw,isNumber:Gf,isBoolean:ow,isObject:ls,isPlainObject:Ii,isEmptyObject:aw,isReadableStream:yw,isRequest:bw,isResponse:Cw,isHeaders:Sw,isUndefined:ts,isDate:lw,isFile:cw,isReactNativeBlob:uw,isReactNative:dw,isBlob:fw,isRegExp:Pw,isFunction:Rt,isStream:pw,isURLSearchParams:vw,isTypedArray:Iw,isFileList:hw,forEach:ri,merge:Ua,extend:ww,trim:_w,stripBOM:xw,inherits:Tw,toFlatObject:Ew,kindOf:Il,kindOfTest:ar,endsWith:Aw,toArray:kw,forEachEntry:Dw,matchAll:Lw,isHTMLForm:Ow,hasOwnProperty:Zi,hasOwnProp:Zi,hasOwnInPrototypeChain:Fs,getSafeProp:nw,reduceDescriptors:Zf,freezeMethods:Rw,toObjectSet:Fw,toCamelCase:Nw,noop:Mw,toFiniteNumber:Bw,findKey:Kf,global:en,isContextDefined:Yf,isSpecCompliantForm:qw,toJSONObject:$w,isAsyncFn:Uw,isThenable:zw,setImmediate:Xf,asap:Vw,isIterable:Jf,isSafeIterable:Hw},Qw=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ww=e=>{const t={};let r,n,s;return e&&e.split(`
529
- `).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||t[r]&&Qw[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function Gw(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const Kw=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Yw=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Dl(e,t){return L.isArray(e)?e.map(r=>Dl(r,t)):Gw(String(e).replace(t,""))}const Zw=e=>Dl(e,Kw),Xw=e=>Dl(e,Yw);function eh(e){const t=Object.create(null);return L.forEach(e.toJSON(),(r,n)=>{t[n]=Xw(r)}),t}const $c=Symbol("internals");function ms(e){return e&&String(e).trim().toLowerCase()}function Di(e){return e===!1||e==null?e:L.isArray(e)?e.map(Di):Zw(String(e))}function Jw(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const ex=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ho(e,t,r,n,s){if(L.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!L.isString(t)){if(L.isString(n))return t.indexOf(n)!==-1;if(L.isRegExp(n))return n.test(t)}}function tx(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function rx(e,t){const r=L.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,i,o){return this[n].call(this,t,s,i,o)},configurable:!0})})}let kt=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function i(a,c,u){const d=ms(c);if(!d)return;const f=L.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Di(a))}const o=(a,c)=>L.forEach(a,(u,d)=>i(u,d,c));if(L.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(L.isString(t)&&(t=t.trim())&&!ex(t))o(Ww(t),r);else if(L.isObject(t)&&L.isSafeIterable(t)){let a=Object.create(null),c,u;for(const d of t){if(!L.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],L.hasOwnProp(a,u)?(c=a[u],a[u]=L.isArray(c)?[...c,d[1]]:[c,d[1]]):a[u]=d[1]}o(a,r)}else t!=null&&i(r,t,n);return this}get(t,r){if(t=ms(t),t){const n=L.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Jw(s);if(L.isFunction(r))return r.call(this,s,n);if(L.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ms(t),t){const n=L.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||Ho(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function i(o){if(o=ms(o),o){const a=L.findKey(n,o);a&&(!r||Ho(n,n[a],a,r))&&(delete n[a],s=!0)}}return L.isArray(t)?t.forEach(i):i(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!t||Ho(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const r=this,n={};return L.forEach(this,(s,i)=>{const o=L.findKey(n,i);if(o){r[o]=Di(s),delete r[i];return}const a=t?tx(i):String(i).trim();a!==i&&delete r[i],r[a]=Di(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return L.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&L.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[$c]=this[$c]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=ms(o);n[a]||(rx(s,o),n[a]=!0)}return L.isArray(t)?t.forEach(i):i(t),this}};kt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(kt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});L.freezeMethods(kt);const nx="[REDACTED ****]";function sx(e){if(L.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function ix(e,t){const r=new Set(t.map(i=>String(i).toLowerCase())),n=[],s=i=>{if(i===null||typeof i!="object"||L.isBuffer(i))return i;if(n.indexOf(i)!==-1)return;i instanceof kt&&(i=i.toJSON()),n.push(i);let o;if(L.isArray(i))o=[],i.forEach((a,c)=>{const u=s(a);L.isUndefined(u)||(o[c]=u)});else{if(!L.isPlainObject(i)&&sx(i))return n.pop(),i;o=Object.create(null);for(const[a,c]of Object.entries(i)){const u=r.has(a.toLowerCase())?nx:s(c);L.isUndefined(u)||(o[a]=u)}}return n.pop(),o};return s(e)}let J=class th extends Error{static from(t,r,n,s,i,o){const a=new th(t.message,r||t.code,n,s,i);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),o&&Object.assign(a,o),a}constructor(t,r,n,s,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,r=t&&L.hasOwnProp(t,"redact")?t.redact:void 0,n=L.isArray(r)&&r.length>0?ix(t,r):L.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";J.ERR_BAD_OPTION="ERR_BAD_OPTION";J.ECONNABORTED="ECONNABORTED";J.ETIMEDOUT="ETIMEDOUT";J.ECONNREFUSED="ECONNREFUSED";J.ERR_NETWORK="ERR_NETWORK";J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";J.ERR_DEPRECATED="ERR_DEPRECATED";J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";J.ERR_BAD_REQUEST="ERR_BAD_REQUEST";J.ERR_CANCELED="ERR_CANCELED";J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";J.ERR_INVALID_URL="ERR_INVALID_URL";J.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ox=null,rh=100;function za(e){return L.isPlainObject(e)||L.isArray(e)}function nh(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function Qo(e,t,r){return e?e.concat(t).map(function(s,i){return s=nh(s),!r&&i?"["+s+"]":s}).join(r?".":""):t}function ax(e){return L.isArray(e)&&!e.some(za)}const lx=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function xo(e,t,r){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=L.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!L.isUndefined(S[C])});const n=r.metaTokens,s=r.visitor||b,i=r.dots,o=r.indexes,a=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?rh:r.maxDepth,u=a&&L.isSpecCompliantForm(t),d=[];if(!L.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(L.isDate(y))return y.toISOString();if(L.isBoolean(y))return y.toString();if(!u&&L.isBlob(y))throw new J("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(y)||L.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function m(y){if(y>c)throw new J("Object is too deeply nested ("+y+" levels). Max depth: "+c,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(x,E){if(!L.isObject(E))return E;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(E),m(C+S.length-1),E})}function b(y,C,S){let _=y;if(L.isReactNative(t)&&L.isReactNativeBlob(y))return t.append(Qo(S,C,i),f(y)),!1;if(y&&!S&&typeof y=="object"){if(L.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=p(y,1);else if(L.isArray(y)&&ax(y)||(L.isFileList(y)||L.endsWith(C,"[]"))&&(_=L.toArray(y)))return C=nh(C),_.forEach(function(E,D){!(L.isUndefined(E)||E===null)&&t.append(o===!0?Qo([C],D,i):o===null?C:C+"[]",f(E))}),!1}return za(y)?!0:(t.append(Qo(S,C,i),f(y)),!1)}const h=Object.assign(lx,{defaultVisitor:b,convertValue:f,isVisitable:za});function v(y,C,S=0){if(!L.isUndefined(y)){if(m(S),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));d.push(y),L.forEach(y,function(x,E){(!(L.isUndefined(x)||x===null)&&s.call(t,x,L.isString(E)?E.trim():E,C,h))===!0&&v(x,C?C.concat(E):[E],S+1)}),d.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Uc(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function Ll(e,t){this._pairs=[],e&&xo(e,this,t)}const sh=Ll.prototype;sh.append=function(t,r){this._pairs.push([t,r])};sh.toString=function(t){const r=t?function(n){return t.call(this,n,Uc)}:Uc;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function cx(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ih(e,t,r){if(!t)return e;const n=L.isFunction(r)?{serialize:r}:r,s=L.getSafeProp(n,"encode")||cx,i=L.getSafeProp(n,"serialize");let o;if(i?o=i(t,n):o=L.isURLSearchParams(t)?t.toString():new Ll(t,n).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class zc{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){L.forEach(this.handlers,function(n){n!==null&&t(n)})}}const Ol={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},ux=typeof URLSearchParams<"u"?URLSearchParams:Ll,dx=typeof FormData<"u"?FormData:null,fx=typeof Blob<"u"?Blob:null,hx={isBrowser:!0,classes:{URLSearchParams:ux,FormData:dx,Blob:fx},protocols:["http","https","file","blob","url","data"]},Nl=typeof window<"u"&&typeof document<"u",Va=typeof navigator=="object"&&navigator||void 0,px=Nl&&(!Va||["ReactNative","NativeScript","NS"].indexOf(Va.product)<0),mx=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",gx=Nl&&window.location.href||"http://localhost",vx=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Nl,hasStandardBrowserEnv:px,hasStandardBrowserWebWorkerEnv:mx,navigator:Va,origin:gx},Symbol.toStringTag,{value:"Module"})),bt={...vx,...hx};function yx(e,t){return xo(e,new bt.classes.URLSearchParams,{visitor:function(r,n,s,i){return bt.isNode&&L.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}const Vc=rh;function oh(e){if(e>Vc)throw new J("FormData field is too deeply nested ("+e+" levels). Max depth: "+Vc,J.ERR_FORM_DATA_DEPTH_EXCEEDED)}function bx(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)oh(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function Cx(e){const t={},r=Object.keys(e);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],t[i]=e[i];return t}function ah(e){function t(r,n,s,i){oh(i);let o=r[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=r.length;return o=!o&&L.isArray(s)?s.length:o,c?(L.hasOwnProp(s,o)?s[o]=L.isArray(s[o])?s[o].concat(n):[s[o],n]:s[o]=n,!a):((!L.hasOwnProp(s,o)||!L.isObject(s[o]))&&(s[o]=[]),t(r,n,s[o],i)&&L.isArray(s[o])&&(s[o]=Cx(s[o])),!a)}if(L.isFormData(e)&&L.isFunction(e.entries)){const r={};return L.forEachEntry(e,(n,s)=>{t(bx(n),s,r,0)}),r}return null}const Tn=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function Sx(e,t,r){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ni={transitional:Ol,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=L.isObject(t);if(i&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return s?JSON.stringify(ah(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){const c=Tn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return yx(t,c).toString();if((a=L.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=Tn(this,"env"),d=u&&u.FormData;return xo(a?{"files[]":t}:t,d&&new d,c)}}return i||s?(r.setContentType("application/json",!1),Sx(t)):t}],transformResponse:[function(t){const r=Tn(this,"transitional")||ni.transitional,n=r&&r.forcedJSONParsing,s=Tn(this,"responseType"),i=s==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(n&&!s||i)){const a=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,Tn(this,"parseReviver"))}catch(c){if(a)throw c.name==="SyntaxError"?J.from(c,J.ERR_BAD_RESPONSE,this,null,Tn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:bt.classes.FormData,Blob:bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch","query"],e=>{ni.headers[e]={}});function Wo(e,t){const r=this||ni,n=t||r,s=kt.from(n.headers);let i=n.data;return L.forEach(e,function(a){i=a.call(r,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function lh(e){return!!(e&&e.__CANCEL__)}let si=class extends J{constructor(t,r,n){super(t??"canceled",J.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function ch(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new J("Request failed with status code "+r.status,r.status>=400&&r.status<500?J.ERR_BAD_REQUEST:J.ERR_BAD_RESPONSE,r.config,r.request,r))}function _x(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function wx(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[i];o||(o=u),r[s]=c,n[s]=u;let f=i,m=0;for(;f!==s;)m+=r[f++],f=f%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),u-o<t)return;const p=d&&u-d;return p?Math.round(m*1e3/p):void 0}}function xx(e,t){let r=0,n=1e3/t,s,i;const o=(u,d=Date.now())=>{r=d,s=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?o(u,d):(s=u,i||(i=setTimeout(()=>{i=null,o(s)},n-f)))},()=>s&&o(s)]}const Xi=(e,t,r=3)=>{let n=0;const s=wx(50,250);return xx(i=>{if(!i||typeof i.loaded!="number")return;const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=a!=null?Math.min(o,a):o,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:a,progress:a?c/a:void 0,bytes:u,rate:d||void 0,estimated:d&&a?(a-c)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(f)},r)},Hc=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Qc=e=>(...t)=>L.asap(()=>e(...t)),Tx=bt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,bt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(bt.origin),bt.navigator&&/(msie|trident)/i.test(bt.navigator.userAgent)):()=>!0,Ex=bt.hasStandardBrowserEnv?{write(e,t,r,n,s,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];L.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),L.isString(n)&&a.push(`path=${n}`),L.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),L.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ax(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kx(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const Ix=/^https?:(?!\/\/)/i,Dx=/[\t\n\r]/g;function Lx(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function Ox(e){return Lx(e).replace(Dx,"")}function Wc(e,t){if(typeof e=="string"&&Ix.test(Ox(e)))throw new J('Invalid URL: missing "//" after protocol',J.ERR_INVALID_URL,t)}function uh(e,t,r,n){Wc(t,n);let s=!Ax(t);return e&&(s||r===!1)?(Wc(e,n),kx(e,t)):t}const Gc=e=>e instanceof kt?{...e}:e;function gn(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(d,f,m,p){return L.isPlainObject(d)&&L.isPlainObject(f)?L.merge.call({caseless:p},d,f):L.isPlainObject(f)?L.merge({},f):L.isArray(f)?f.slice():f}function s(d,f,m,p){if(L.isUndefined(f)){if(!L.isUndefined(d))return n(void 0,d,m,p)}else return n(d,f,m,p)}function i(d,f){if(!L.isUndefined(f))return n(void 0,f)}function o(d,f){if(L.isUndefined(f)){if(!L.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function a(d){const f=L.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!L.isUndefined(f))if(L.isPlainObject(f)){if(L.hasOwnProp(f,d))return f[d]}else return;const m=L.hasOwnProp(e,"transitional")?e.transitional:void 0;if(L.isPlainObject(m)&&L.hasOwnProp(m,d))return m[d]}function c(d,f,m){if(L.hasOwnProp(t,m))return n(d,f);if(L.hasOwnProp(e,m))return n(void 0,d)}const u={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(d,f,m)=>s(Gc(d),Gc(f),m,!0)};return L.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=L.hasOwnProp(u,f)?u[f]:s,p=L.hasOwnProp(e,f)?e[f]:void 0,b=L.hasOwnProp(t,f)?t[f]:void 0,h=m(p,b,f);L.isUndefined(h)&&m!==c||(r[f]=h)}),L.hasOwnProp(t,"validateStatus")&&L.isUndefined(t.validateStatus)&&a("validateStatusUndefinedResolves")===!1&&(L.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const Nx=["content-type","content-length"];function jx(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{Nx.includes(n.toLowerCase())&&e.set(n,s)})}const Px=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function dh(e){const t=gn({},e),r=m=>L.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let s=r("withXSRFToken");const i=r("xsrfHeaderName"),o=r("xsrfCookieName");let a=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=a=kt.from(a),t.url=ih(uh(u,f,d,t),r("params"),r("paramsSerializer")),c){const m=L.getSafeProp(c,"username")||"",p=L.getSafeProp(c,"password")||"";a.set("Authorization","Basic "+btoa(m+":"+(p?Px(p):"")))}if(L.isFormData(n)&&(bt.hasStandardBrowserEnv||bt.hasStandardBrowserWebWorkerEnv||L.isReactNative(n)?a.setContentType(void 0):L.isFunction(n.getHeaders)&&jx(a,n.getHeaders(),r("formDataHeaderPolicy"))),bt.hasStandardBrowserEnv&&(L.isFunction(s)&&(s=s(t)),s===!0||s==null&&Tx(t.url))){const p=i&&o&&Ex.read(o);p&&a.set(i,p)}return t}const Rx=typeof XMLHttpRequest<"u",Fx=Rx&&function(e){return new Promise(function(r,n){const s=dh(e);let i=s.data;const o=kt.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:u}=s,d,f,m,p,b;function h(){p&&p(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=kt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),x={data:!a||a==="text"||a==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};ch(function(D){r(D),h()},function(D){n(D),h()},x),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new J("Request aborted",J.ECONNABORTED,e,v)),h(),v=null)},v.onerror=function(_){const x=_&&_.message?_.message:"Network Error",E=new J(x,J.ERR_NETWORK,e,v);E.event=_||null,n(E),h(),v=null},v.ontimeout=function(){let _=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const x=s.transitional||Ol;s.timeoutErrorMessage&&(_=s.timeoutErrorMessage),n(new J(_,x.clarifyTimeoutError?J.ETIMEDOUT:J.ECONNABORTED,e,v)),h(),v=null},i===void 0&&o.setContentType(null),"setRequestHeader"in v&&L.forEach(eh(o),function(_,x){v.setRequestHeader(x,_)}),L.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),a&&a!=="json"&&(v.responseType=s.responseType),u&&([m,b]=Xi(u,!0),v.addEventListener("progress",m)),c&&v.upload&&([f,p]=Xi(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",p)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new si(null,e,v):S),v.abort(),h(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const C=_x(s.url);if(C&&!bt.protocols.includes(C)){n(new J("Unsupported protocol "+C+":",J.ERR_BAD_REQUEST,e));return}v.send(i||null)})},Mx=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,o();const u=c instanceof Error?c:this.reason;r.abort(u instanceof J?u:new si(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,s(new J(`timeout of ${t}ms exceeded`,J.ETIMEDOUT))},t);const o=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:a}=r;return a.unsubscribe=()=>L.asap(o),a},Bx=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},qx=async function*(e,t){for await(const r of $x(e))yield*Bx(r,t)},$x=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Kc=(e,t,r,n)=>{const s=qx(e,t);let i=0,o,a=c=>{o||(o=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){a(),c.close();return}let f=d.byteLength;if(r){let m=i+=f;r(m)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},Ji=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Ux=(e,t,r)=>t+2<r&&Ji(e.charCodeAt(t+1))&&Ji(e.charCodeAt(t+2));function zx(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let o=n.length;const a=n.length;for(let p=0;p<a;p++)if(n.charCodeAt(p)===37&&p+2<a){const b=n.charCodeAt(p+1),h=n.charCodeAt(p+2);Ji(b)&&Ji(h)&&(o-=2,p+=2)}let c=0,u=a-1;const d=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const m=Math.floor(o/4)*3-(c||0);return m>0?m:0}let i=0;for(let o=0,a=n.length;o<a;o++){const c=n.charCodeAt(o);if(c===37&&Ux(n,o,a))i+=1,o+=2;else if(c<128)i+=1;else if(c<2048)i+=2;else if(c>=55296&&c<=56319&&o+1<a){const u=n.charCodeAt(o+1);u>=56320&&u<=57343?(i+=4,o++):i+=3}else i+=3}return i}const jl="1.18.0",Yc=64*1024,{isFunction:gi}=L,Vx=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Zc=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Xc=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hx=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},Qx=e=>{const t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:i,Response:o}=e,a=s?gi(s):typeof fetch=="function",c=gi(i),u=gi(o);if(!a)return!1;const d=a&&gi(r),f=a&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new i(y).arrayBuffer())),m=c&&d&&Xc(()=>{let y=!1;const C=new i(bt.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),p=u&&d&&Xc(()=>L.isReadableStream(new o("").body)),b={stream:p&&(y=>y.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let _=C&&C[y];if(_)return _.call(C);throw new J(`Response type '${y}' is not supported`,J.ERR_NOT_SUPPORT,S)})});const h=async y=>{if(y==null)return 0;if(L.isBlob(y))return y.size;if(L.isSpecCompliantForm(y))return(await new i(bt.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(L.isArrayBufferView(y)||L.isArrayBuffer(y))return y.byteLength;if(L.isURLSearchParams(y)&&(y=y+""),L.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=L.toFiniteNumber(y.getContentLength());return S??h(C)};return async y=>{let{url:C,method:S,data:_,signal:x,cancelToken:E,timeout:D,onDownloadProgress:T,onUploadProgress:j,responseType:P,headers:O,withCredentials:N="same-origin",fetchOptions:R,maxContentLength:M,maxBodyLength:$}=dh(y);const ee=L.isNumber(M)&&M>-1,H=L.isNumber($)&&$>-1,te=B=>L.hasOwnProp(y,B)?y[B]:void 0;let de=s||fetch;P=P?(P+"").toLowerCase():"text";let fe=Mx([x,E&&E.toAbortSignal()],D),pe=null;const ae=fe&&fe.unsubscribe&&(()=>{fe.unsubscribe()});let we,ye=null;const F=()=>new J("Request body larger than maxBodyLength limit",J.ERR_BAD_REQUEST,y,pe);try{let B;const Z=te("auth");if(Z){const Q=L.getSafeProp(Z,"username")||"",Ce=L.getSafeProp(Z,"password")||"";B={username:Q,password:Ce}}if(Hx(C)){const Q=new URL(C,bt.origin);if(!B&&(Q.username||Q.password)){const Ce=Zc(Q.username),qe=Zc(Q.password);B={username:Ce,password:qe}}(Q.username||Q.password)&&(Q.username="",Q.password="",C=Q.href)}if(B&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa(Vx((B.username||"")+":"+(B.password||""))))),ee&&typeof C=="string"&&C.startsWith("data:")&&zx(C)>M)throw new J("maxContentLength size of "+M+" exceeded",J.ERR_BAD_RESPONSE,y,pe);if(H&&S!=="get"&&S!=="head"){const Q=await h(_);if(typeof Q=="number"&&isFinite(Q)&&(we=Q,Q>$))throw F()}const he=H&&(L.isReadableStream(_)||L.isStream(_)),be=(Q,Ce,qe)=>Kc(Q,Yc,et=>{if(H&&et>$)throw ye=F();Ce&&Ce(et)},qe);if(m&&S!=="get"&&S!=="head"&&(j||he)){if(we=we??await v(O,_),we!==0||he){let Q=new i(C,{method:"POST",body:_,duplex:"half"}),Ce;if(L.isFormData(_)&&(Ce=Q.headers.get("content-type"))&&O.setContentType(Ce),Q.body){const[qe,et]=j&&Hc(we,Xi(Qc(j)))||[];_=be(Q.body,qe,et)}}}else if(he&&!c&&d&&S!=="get"&&S!=="head")_=be(_);else if(he&&c&&!m&&S!=="get"&&S!=="head")throw new J("Stream request bodies are not supported by the current fetch implementation",J.ERR_NOT_SUPPORT,y,pe);L.isString(N)||(N=N?"include":"omit");const me=c&&"credentials"in i.prototype;if(L.isFormData(_)){const Q=O.getContentType();Q&&/^multipart\/form-data/i.test(Q)&&!/boundary=/i.test(Q)&&O.delete("content-type")}O.set("User-Agent","axios/"+jl,!1);const le={...R,signal:fe,method:S.toUpperCase(),headers:eh(O.normalize()),body:_,duplex:"half",credentials:me?N:void 0};pe=c&&new i(C,le);let ve=await(c?de(pe,R):de(C,le));const Te=kt.from(ve.headers);if(ee){const Q=L.toFiniteNumber(Te.getContentLength());if(Q!=null&&Q>M)throw new J("maxContentLength size of "+M+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}const Y=p&&(P==="stream"||P==="response");if(p&&ve.body&&(T||ee||Y&&ae)){const Q={};["status","statusText","headers"].forEach(tt=>{Q[tt]=ve[tt]});const Ce=L.toFiniteNumber(Te.getContentLength()),[qe,et]=T&&Hc(Ce,Xi(Qc(T),!0))||[];let $e=0;const We=tt=>{if(ee&&($e=tt,$e>M))throw new J("maxContentLength size of "+M+" exceeded",J.ERR_BAD_RESPONSE,y,pe);qe&&qe(tt)};ve=new o(Kc(ve.body,Yc,We,()=>{et&&et(),ae&&ae()}),Q)}P=P||"text";let ce=await b[L.findKey(b,P)||"text"](ve,y);if(ee&&!p&&!Y){let Q;if(ce!=null&&(typeof ce.byteLength=="number"?Q=ce.byteLength:typeof ce.size=="number"?Q=ce.size:typeof ce=="string"&&(Q=typeof n=="function"?new n().encode(ce).byteLength:ce.length)),typeof Q=="number"&&Q>M)throw new J("maxContentLength size of "+M+" exceeded",J.ERR_BAD_RESPONSE,y,pe)}return!Y&&ae&&ae(),await new Promise((Q,Ce)=>{ch(Q,Ce,{data:ce,headers:kt.from(ve.headers),status:ve.status,statusText:ve.statusText,config:y,request:pe})})}catch(B){if(ae&&ae(),fe&&fe.aborted&&fe.reason instanceof J){const Z=fe.reason;throw Z.config=y,pe&&(Z.request=pe),B!==Z&&(Z.cause=B),Z}throw ye?(pe&&!ye.request&&(ye.request=pe),ye):B instanceof J?(pe&&!B.request&&(B.request=pe),B):B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new J("Network Error",J.ERR_NETWORK,y,pe,B&&B.response),{cause:B.cause||B}):J.from(B,B&&B.code,y,pe,B&&B.response)}}},Wx=new Map,fh=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,i=[n,s,r];let o=i.length,a=o,c,u,d=Wx;for(;a--;)c=i[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:Qx(t)),d=u;return u};fh();const Pl={http:ox,xhr:Fx,fetch:{get:fh}};L.forEach(Pl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Jc=e=>`- ${e}`,Gx=e=>L.isFunction(e)||e===null||e===!1;function Kx(e,t){e=L.isArray(e)?e:[e];const{length:r}=e;let n,s;const i={};for(let o=0;o<r;o++){n=e[o];let a;if(s=n,!Gx(n)&&(s=Pl[(a=String(n)).toLowerCase()],s===void 0))throw new J(`Unknown adapter '${a}'`);if(s&&(L.isFunction(s)||(s=s.get(t))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=r?o.length>1?`since :
531
- `+o.map(Jc).join(`
532
- `):" "+Jc(o[0]):"as no adapter specified";throw new J("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const hh={getAdapter:Kx,adapters:Pl};function Go(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new si(null,e)}function eu(e){return Go(e),e.headers=kt.from(e.headers),e.data=Wo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),hh.getAdapter(e.adapter||ni.adapter,e)(e).then(function(n){Go(e),e.response=n;try{n.data=Wo.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=kt.from(n.headers),n},function(n){if(!lh(n)&&(Go(e),n&&n.response)){e.response=n.response;try{n.response.data=Wo.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=kt.from(n.response.headers)}return Promise.reject(n)})}const To={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{To[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const tu={};To.transitional=function(t,r,n){function s(i,o){return"[Axios v"+jl+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,a)=>{if(t===!1)throw new J(s(o," has been removed"+(r?" in "+r:"")),J.ERR_DEPRECATED);return r&&!tu[o]&&(tu[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,o,a):!0}};To.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function Yx(e,t,r){if(typeof e!="object")throw new J("options must be an object",J.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const i=n[s],o=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(o){const a=e[i],c=a===void 0||o(a,i,e);if(c!==!0)throw new J("option "+i+" must be "+c,J.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new J("Unknown option "+i,J.ERR_BAD_OPTION)}}const Li={assertOptions:Yx,validators:To},St=Li.validators;let hn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new zc,response:new zc}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=(()=>{if(!s.stack)return"";const o=s.stack.indexOf(`
533
- `);return o===-1?"":s.stack.slice(o+1)})();try{if(!n.stack)n.stack=i;else if(i){const o=i.indexOf(`
534
- `),a=o===-1?-1:i.indexOf(`
535
- `,o+1),c=a===-1?"":i.slice(a+1);String(n.stack).endsWith(c)||(n.stack+=`
536
- `+i)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=gn(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&Li.assertOptions(n,{silentJSONParsing:St.transitional(St.boolean),forcedJSONParsing:St.transitional(St.boolean),clarifyTimeoutError:St.transitional(St.boolean),legacyInterceptorReqResOrdering:St.transitional(St.boolean),advertiseZstdAcceptEncoding:St.transitional(St.boolean),validateStatusUndefinedResolves:St.transitional(St.boolean)},!1),s!=null&&(L.isFunction(s)?r.paramsSerializer={serialize:s}:Li.assertOptions(s,{encode:St.function,serialize:St.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Li.assertOptions(r,{baseUrl:St.spelling("baseURL"),withXsrfToken:St.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&L.merge(i.common,i[r.method]);i&&L.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete i[b]}),r.headers=kt.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(h){if(typeof h.runWhen=="function"&&h.runWhen(r)===!1)return;c=c&&h.synchronous;const v=r.transitional||Ol;v&&v.legacyInterceptorReqResOrdering?a.unshift(h.fulfilled,h.rejected):a.push(h.fulfilled,h.rejected)});const u=[];this.interceptors.response.forEach(function(h){u.push(h.fulfilled,h.rejected)});let d,f=0,m;if(!c){const b=[eu.bind(this),void 0];for(b.unshift(...a),b.push(...u),m=b.length,d=Promise.resolve(r);f<m;)d=d.then(b[f++],b[f++]);return d}m=a.length;let p=r;for(;f<m;){const b=a[f++],h=a[f++];try{p=b(p)}catch(v){h.call(this,v);break}}try{d=eu.call(this,p)}catch(b){return Promise.reject(b)}for(f=0,m=u.length;f<m;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=gn(this.defaults,t);const r=uh(t.baseURL,t.url,t.allowAbsoluteUrls,t);return ih(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){hn.prototype[t]=function(r,n){return this.request(gn(n||{},{method:t,url:r,data:n&&L.hasOwnProp(n,"data")?n.data:void 0}))}});L.forEach(["post","put","patch","query"],function(t){function r(n){return function(i,o,a){return this.request(gn(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}hn.prototype[t]=r(),t!=="query"&&(hn.prototype[t+"Form"]=r(!0))});let Zx=class ph{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{n.subscribe(a),i=a}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},t(function(i,o,a){n.reason||(n.reason=new si(i,o,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new ph(function(s){t=s}),cancel:t}}};function Xx(e){return function(r){return e.apply(null,r)}}function Jx(e){return L.isObject(e)&&e.isAxiosError===!0}const Ha={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ha).forEach(([e,t])=>{Ha[t]=e});function mh(e){const t=new hn(e),r=Hf(hn.prototype.request,t);return L.extend(r,hn.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return mh(gn(e,s))},r}const rt=mh(ni);rt.Axios=hn;rt.CanceledError=si;rt.CancelToken=Zx;rt.isCancel=lh;rt.VERSION=jl;rt.toFormData=xo;rt.AxiosError=J;rt.Cancel=rt.CanceledError;rt.all=function(t){return Promise.all(t)};rt.spread=Xx;rt.isAxiosError=Jx;rt.mergeConfig=gn;rt.AxiosHeaders=kt;rt.formToJSON=e=>ah(L.isHTMLForm(e)?new FormData(e):e);rt.getAdapter=hh.getAdapter;rt.HttpStatusCode=Ha;rt.default=rt;const{Axios:Vq,AxiosError:Hq,CanceledError:Qq,isCancel:Wq,CancelToken:Gq,VERSION:Kq,all:Yq,Cancel:Zq,isAxiosError:Xq,spread:Jq,toFormData:e$,AxiosHeaders:t$,HttpStatusCode:r$,formToJSON:n$,getAdapter:s$,mergeConfig:i$,create:o$}=rt;let Qa="";function gh(e){Qa=e}const Fe=rt.create({timeout:3e4});function e0(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Fe.interceptors.request.use(async e=>{var s,i,o;const{useEditorStore:t}=await Promise.resolve().then(()=>db),r=t.getState(),n=(s=r.editorConfig)==null?void 0:s.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=e0(e.url,(o=(i=r.editorConfig)==null?void 0:i.config)==null?void 0:o.apiSlug),Qa&&(e.baseURL=Qa),e});const vh="/portal";async function yh(e){var n,s,i,o,a,c,u;const t=await Fe.get(`${vh}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.questionset;if(!r||!r.identifier){const d=((o=(i=t.data)==null?void 0:i.params)==null?void 0:o.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function t0(e){var r,n;return e.length?((n=(r=(await Fe.post(`${vh}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Eo(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",i=r.mimeType??"",o=r.children,a=Array.isArray(o)?o.map(u=>Eo(u,n)):[],c=i==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent"||i==="application/vnd.sunbird.questionset"&&a.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:a,metadata:r,parent:t}}async function bh(e){var s,i,o,a,c,u,d;const t=await Fe.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(i=(s=t.data)==null?void 0:s.result)==null?void 0:i.content;if(!r||!r.identifier){const f=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=Eo(r);return{content:r,rootNode:n}}async function r0(e){const t=await yh(e),r=Eo(t);return{content:t,rootNode:r}}async function n0(e,t,r,n){var i;return((i=(await Fe.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:i.result)??{}}async function s0(e,t=""){await Fe.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function Ch(e){var n,s,i,o,a,c,u;const t=await Fe.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.content;if(!r||!r.identifier){const d=((o=(i=t.data)==null?void 0:i.params)==null?void 0:o.errmsg)||((c=(a=t.data)==null?void 0:a.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${d}`)}return r}async function i0(e){var r,n;return(n=(r=(await Fe.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function o0(e){await Fe.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function a0(e,t){await Fe.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function l0(e,t){await Fe.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}const c0="application/vnd.sunbird.questionset";function Sh(e){let t=!1,r=!0;function n(s){for(const i of s){const o=i.children??[];if(o.length>0){n(o);continue}t=!0,i.objectType==="QuestionSet"&&i.mimeType===c0||(r=!1)}}return n(e.children??[]),t&&r}const ru=new Map;async function _h(e){const t=ru.get(e);if(t)return t;const r=await Ch(e),{children:n,...s}=r??{},i={qualifies:Sh(r),meta:s};return ru.set(e,i),i}async function wh(e){return(await _h(e)).qualifies}async function u0(e){var n;const t=e.children??[],r=[];for(let s=0;s<t.length;s++){const i=t[s],o=i.children??[],a=[];for(const c of o){let u=!!((n=c.metadata)!=null&&n.isAssessmentCourse);if(!u){if((c.children??[]).length>0)u=Sh(c);else if(o.length===1&&(s===0||s===t.length-1))try{u=await wh(c.identifier)}catch(d){console.error("[lpStructure] assessment-course check failed on load:",d)}}a.push({...c,isFolder:!1,children:[],metadata:{...c.metadata??{},...u?{isAssessmentCourse:!0}:{}}})}r.push({...i,children:a})}return{...e,children:r}}function lt(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function d0(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function f0(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:Bs(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,i)=>!Bs(e,i)).length}}function Ms(e,t){return t==="pre"?e.length>0&&lt(e[0]):e.length>1&&lt(e[e.length-1])}function Bs(e,t){const r=d0(t,e.length,lt(e[t]));return r==="pre"||r==="post"}function Wa(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&Bs(e,r)}function h0(e){return Ms(e,"pre")?Ms(e,"post")?null:"post":"pre"}function p0(e,t,r){if(t<0||t>=e.length)return!1;const n=lt(e[0])?e[0]:null,s=e.length>1&&lt(e[e.length-1])?e[e.length-1]:null;if(!n&&!s)return!0;const i=[...e],[o]=i.splice(t,1);return i.splice(r,0,o),!(n&&i[0]!==n||s&&i[i.length-1]!==s)}function nu(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var i;return!!((i=s.metadata)!=null&&i.isAssessmentCourse)}):!0}function vn(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function xh(e,t){var n,s;return e?((n=t[e.id])==null?void 0:n.framework)??((s=e.metadata)==null?void 0:s.framework):void 0}function Th(e,t){return!!xh(e,t)}function Eh(e,t){if(!e||!t)return[];const r=new Set,n=e.children??[];return n.forEach((s,i)=>{var o,a;Bs(n,i)?vn((o=s.children[0].metadata)==null?void 0:o[t]).forEach(c=>r.add(c)):vn((a=s.metadata)==null?void 0:a[t]).forEach(c=>r.add(c))}),Array.from(r)}function m0(e,t,r){var u,d;if(!e||!t)return null;const n=Eh(e,t),s=((u=r[e.id])==null?void 0:u[t])??((d=e.metadata)==null?void 0:d[t]),i=vn(s),o=[...n].sort(),a=[...i].sort();return o.length===a.length&&o.every((f,m)=>f===a[m])?null:n}function g0(e,t,r){if(!e||!t||r.length===0)return[];const n=e.children??[];return n.filter((s,i)=>{var a;return Bs(n,i)?!1:vn((a=s.metadata)==null?void 0:a[t]).some(c=>!r.includes(c))})}function Ah(e,t,r){var s;if(!e||!r||t.length===0)return[];const n=new Set;for(const i of e.children??[])vn((s=i.metadata)==null?void 0:s[r]).forEach(o=>n.add(o));return t.filter(i=>!n.has(i))}const kh=new Set(["adaptive"]);function Rl(e,t,r,n={}){var b,h,v,y;const s=[];if(!e)return s;const i=((b=n[e.id])==null?void 0:b.policy)??((h=e.metadata)==null?void 0:h.policy);i||s.push({code:"policyMissing",message:"Set a consumption policy for this path."});const o=e.children??[],a=o[0],c=o.length>1?o[o.length-1]:void 0,u=lt(a),d=lt(c);!u&&i&&kh.has(i)&&s.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[a,"Prior Assessment"],[c,"Outcome Assessment"]].forEach(([C,S])=>{var E,D;if(!C)return;const _=C.children??[];_.some(T=>{var j;return!!((j=T.metadata)!=null&&j.isAssessmentCourse)})&&(_.length!==1||!((D=(E=_[0])==null?void 0:E.metadata)!=null&&D.isAssessmentCourse))&&s.push({code:"slotNotPure",nodeId:C.id,message:`${S} must contain exactly one question-set-only course.`})});const f=new Set,m=(C,S)=>{f.has(C)&&s.push({code:"duplicateCourse",nodeId:S,message:"A course appears more than once in this path."}),f.add(C)},p=o.slice(u?1:0,o.length-(d?1:0));u&&m(a.children[0].id,a.id),d&&m(c.children[0].id,c.id);for(const C of p){const S=C.children??[],_=S.length===0;_&&s.push({code:"emptyLevel",nodeId:C.id,message:`"${C.name}" has no courses yet.`});const x=t?vn((v=C.metadata)==null?void 0:v[t]):[];if(x.length===0)_||s.push({code:"levelMissingSkills",nodeId:C.id,message:`"${C.name}" needs at least one skill selected.`});else{if(r.length>0){const D=x.filter(T=>!r.includes(T));D.length>0&&s.push({code:"levelSkillsOutOfScope",nodeId:C.id,message:`"${C.name}" has skills outside the current scope: ${D.join(", ")}.`})}const E=Ah(C,x,t);E.length>0&&s.push({code:"levelSkillsUncovered",nodeId:C.id,message:`"${C.name}" has no course covering: ${E.join(", ")}.`})}for(const E of S)m(E.id,C.id),(t?vn((y=E.metadata)==null?void 0:y[t]):[]).length===0&&s.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}return s}async function v0(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],s=r.length>1?r[r.length-1]:void 0;for(const[i,o]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!i||!lt(i))continue;const a=i.children[0].id;await wh(a)||t.push({code:"slotCourseChanged",nodeId:i.id,message:`${o}'s course is no longer question-set-only — pick a different course.`})}return t}function Nt(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function Ih(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const i=Ih(s.children,t,r+1);if(i>=0)return i}}return-1}const su=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Dh(e,t,r,n){return e.map(s=>{if(s.id===t){const i=r.metadata??{},o=n!=null&&n.length?new Set([...su,...n]):su,a={};for(const c of o)c in r&&(a[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...a,...i}}}return s.children&&s.children.length>0?{...s,children:Dh(s.children,t,r,n)}:s})}function Oi(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Oi(n.children,t,r)}:n)}function Lh(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]];return i.splice(n,0,r),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:Lh(s.children,t,r,n)}:s})}function Ga(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Ga(r.children,t):[]}))}function Ka(e,t,r,n){return e.map(s=>{if(s.id===t){const i=[...s.children??[]],[o]=i.splice(r,1);return i.splice(n,0,o),{...s,children:i}}return s.children&&s.children.length>0?{...s,children:Ka(s.children,t,r,n)}:s})}function Oh(e,t){return e.map(r=>{const n=t[r.id]??r.id,s=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:s,children:r.children?Oh(r.children,t):[]}})}function y0(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function b0(e,t){const r=Nt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Nt(e,s.parent):void 0;return n}const re=ei((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:i}=t(),o=Nt(n,r),a=i(r),c={...(o==null?void 0:o.metadata)??{},...s[r]??{}};K.getState().setNodeFlags({isFolder:(o==null?void 0:o.isFolder)??!1,isRoot:!(o!=null&&o.parent),isQuml:!1}),yr.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:a,activeNodeMeta:c})},updateNode:(r,n,s)=>{if(e(i=>({treeData:Dh(i.treeData,r,n,s),treeCache:{...i.treeCache,[r]:{...i.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const i=Nt(t().treeData,r);e(o=>({activeNodeMeta:{...(i==null?void 0:i.metadata)??{},...o.treeCache[r]??{}}}))}t().markDirty()},addNode:(r,n)=>{var m,p,b;const s=t(),i=K.getState().editorProfile,o=((p=(m=K.getState().editorConfig)==null?void 0:m.config)==null?void 0:p.maxDepth)??i.maxDepth,a=Ih(s.treeData,r);if(a>=o)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${o}). parentDepth=${a}`),"";const c="temp-"+Math.random().toString(36).slice(2),u={id:c,identifier:c,name:i.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:c,name:i.defaultUnitName,contentType:i.unitContentType,primaryCategory:i.unitPrimaryCategory,visibility:"Parent"}},d=((b=Nt(s.treeData,r))==null?void 0:b.children)??[],f=i.derivedRoles&&Ms(d,"post");return e(h=>({treeData:f?Lh(h.treeData,r,u,d.length-1):Oi(h.treeData,r,u),treeCache:{...h.treeCache,[c]:{...u.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var s;const n=(s=t().treeData[0])==null?void 0:s.id;r!==n&&e(i=>({treeData:Ga(i.treeData,r),selectedNodeId:i.selectedNodeId===r?null:i.selectedNodeId}))},reorderChildren:(r,n,s)=>{var a;const i=K.getState().editorProfile,o=(a=t().treeData[0])==null?void 0:a.id;if(i.derivedRoles&&r===o){const c=Nt(t().treeData,r);if(c!=null&&c.children&&!p0(c.children,n,s))return}e(c=>({treeData:Ka(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var u,d,f;const i=K.getState().editorProfile,o=Nt(t().treeData,r),a=Nt(t().treeData,s);if(!(a!=null&&a.isFolder))return;const c=(u=t().treeData[0])==null?void 0:u.id;if(!(i.derivedRoles&&(o!=null&&o.isFolder)&&s!==c)){if(i.derivedRoles&&o&&!o.isFolder){const m=!!((d=o.metadata)!=null&&d.isAssessmentCourse),p=((f=t().treeData[0])==null?void 0:f.children)??[];if(!nu(a,m,Wa(p,a)))return}e(m=>{const p=Nt(m.treeData,r);if(!p)return m;let b=Ga(m.treeData,r);return b=Oi(b,s,{...p,parent:s}),{treeData:b}}),t().markDirty()}},addResource:(r,n,s)=>{var b,h,v,y,C,S;const i=K.getState().editorConfig,o=K.getState().editorProfile,a=(b=t().treeData[0])==null?void 0:b.id,c=!!(s!=null&&s.isAssessmentCourse);if(o.derivedRoles&&n===a){if(!c||Nt(t().treeData,r.identifier))return!1;const _=t().treeData[0],x=(_==null?void 0:_.children)??[],E=(s==null?void 0:s.slot)??h0(x);if(!E||Ms(x,E))return!1;const D=t().addNode(a,"unit");if(!D)return!1;const{learningPath:T}=kl.getState().labelConfig;if(t().updateNode(D,{name:E==="pre"?T.priorAssessmentLabel:T.outcomeAssessmentLabel}),E==="pre"){const j=(((v=(h=t().treeData[0])==null?void 0:h.children)==null?void 0:v.length)??1)-1;e(P=>({treeData:Ka(P.treeData,a,j,0)}))}return t().addResource(r,D,s)}if(!(((y=i==null?void 0:i.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===a||Nt(t().treeData,r.identifier))return!1;const d=Nt(t().treeData,n);if(!(d!=null&&d.isFolder))return!1;if(o.derivedRoles){const _=((C=t().treeData[0])==null?void 0:C.children)??[];if(!nu(d,c,Wa(_,d)))return!1}const f=((S=i==null?void 0:i.config)==null?void 0:S.maxContentsLimit)??1200;if(y0(t().treeData)>=f)return!1;const p={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(_=>({treeData:Oi(_.treeData,n,p)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=K.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const i=s.treeData[0];if(!i)return s;const o=[];for(const a of i.children??[]){const c=lt(a),u=(a.children??[]).filter(d=>{var p;if(d.isFolder)return!0;const f=(p=d.metadata)==null?void 0:p.framework,m=!f||(Array.isArray(f)?f.includes(r):f===r);return m||n++,m});c&&u.length===0||o.push(u.length===(a.children??[]).length?a:{...a,children:u})}return n===0?s:{treeData:[{...i,children:o}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(s=>{const i=s.treeData[0];if(!i)return s;const o={...s.treeCache},a=(i.children??[]).map(c=>{var m,p;if(!(((m=c.metadata)==null?void 0:m[r])!==void 0||((p=o[c.id])==null?void 0:p[r])!==void 0))return c;n++;const{[r]:d,...f}=c.metadata??{};if(o[c.id]){const{[r]:b,...h}=o[c.id];o[c.id]=h}return{...c,metadata:f}});return n===0?s:{treeData:[{...i,children:a}],treeCache:o}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Oh(n.treeData,r),i={};for(const[a,c]of Object.entries(n.treeCache)){const u=r[a]??a,{isNew:d,...f}=c;i[u]=f}const o=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:i,selectedNodeId:o}})},getNodeById:r=>Nt(t().treeData,r),getChildrenOf:r=>{const n=Nt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>b0(t().treeData,r)})),C0="_spin_1ah4d_9",S0={spin:C0};function oe(){return kl(e=>e.labelConfig)}const _0=({size:e=16,color:t="currentColor"})=>{const r=oe();return l.jsx("svg",{className:S0.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},Re=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:i,className:o,type:a="button"})=>l.jsxs("button",{type:a,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${o??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(_0,{size:14}):null,i]}),Nh=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function iu(e){var r,n;return(n=(r=(await Fe.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function w0(e){var r,n;return((n=(r=(await Fe.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function Ao(e,t){const r=Jn({queryKey:["framework",e],queryFn:()=>iu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=Jn({queryKey:["framework",n],queryFn:()=>iu(n),enabled:!!n,staleTime:300*1e3}),i=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:i,isLoading:r.isLoading||s.isLoading}}function jh(e){if(!(e!=null&&e.length))return null;const t=e.reduce((r,n)=>(n.index??-1/0)>(r.index??-1/0)?n:r);return{code:t.code,terms:t.terms??[]}}function x0(e){var n,s,i,o;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!lt(t))return;const r=(o=(i=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:i.metadata)==null?void 0:o.framework;return Array.isArray(r)?r[0]:r}function lr(){var i;const e=K(o=>o.editorConfig),t=K(o=>o.contentFramework),r=re(o=>o.treeData),n=x0(r[0])??t??((i=e==null?void 0:e.context)==null?void 0:i.framework),{organisationFramework:s}=Ao(n);return jh(s==null?void 0:s.categories)}function T0(e,t,r){var u,d,f,m;const n={scope:((t==null?void 0:t.terms)??[]).map(p=>p.name),source:"manual"};if(!t)return n;const s=(u=e==null?void 0:e.children)==null?void 0:u[0];if(!lt(s))return n;const i=(d=s==null?void 0:s.children)==null?void 0:d[0];if(!i)return n;const a=((f=r[i.id])==null?void 0:f[t.code])??((m=i.metadata)==null?void 0:m[t.code]);return{scope:Array.isArray(a)?a:a?[a]:[],source:"prior"}}function ii(){const e=lr(),t=re(n=>n.treeData),r=re(n=>n.treeCache);return g.useMemo(()=>T0(t[0],e,r),[t,e,r])}const E0="_overlay_kdzmi_1",A0="_modal_kdzmi_15",k0="_modalHeader_kdzmi_27",I0="_modalHeaderClose_kdzmi_37",D0="_modalBody_kdzmi_55",L0="_modalFooter_kdzmi_62",O0="_checkRow_kdzmi_69",N0="_formGroup_kdzmi_112",j0="_textarea_kdzmi_123",P0="_sliderGroup_kdzmi_144",R0="_sliderValue_kdzmi_156",F0="_sliderLabels_kdzmi_164",M0="_sectionTitle_kdzmi_172",Ae={overlay:E0,modal:A0,modalHeader:k0,modalHeaderClose:I0,modalBody:D0,modalFooter:L0,checkRow:O0,formGroup:N0,textarea:j0,sliderGroup:P0,sliderValue:R0,sliderLabels:F0,sectionTitle:M0},B0=({objectType:e,onConfirm:t,onCancel:r})=>{const n=oe(),s=re(b=>b.treeData[0]),i=re(b=>b.treeCache),o=lr(),{scope:a}=ii(),[c,u]=g.useState(null),d=Rl(s,o==null?void 0:o.code,a,i);g.useEffect(()=>{let b=!1;return u(null),v0(s).then(h=>{b||u(h)}),()=>{b=!0}},[s]);const f=c===null,m=[...d,...c??[]],p=!f&&m.length===0;return l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Ae.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ae.modalBody,children:m.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:f?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ae.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:m.map((b,h)=>l.jsx("li",{children:b.message},`${b.code}-${b.nodeId??h}`))})]})}),l.jsxs("div",{className:Ae.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:t,disabled:!p,children:n.publishChecklist.yesButton})]})]})})},q0=({contentId:e,onConfirm:t,onCancel:r})=>{const n=oe(),s=K(m=>{var p,b;return(b=(p=m.editorConfig)==null?void 0:p.config)==null?void 0:b.objectType})||"Content",i=K(m=>m.editorProfile.key==="learningPath"),o=K(m=>m.publishChecklist)??[],[a,c]=g.useState({}),u=o.every(m=>a[m.code]),d=o.length===0||u,f=()=>{t()};return i?l.jsx(B0,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Ae.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ae.modalBody,children:o.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Ae.sectionTitle,children:n.publishChecklist.checklistInstructions}),o.map(m=>l.jsxs("label",{className:Ae.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!a[m.code],onChange:p=>c(b=>({...b,[m.code]:p.target.checked}))}),l.jsx("span",{children:m.label})]},m.code))]})}),l.jsxs("div",{className:Ae.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(Re,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},$0=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=oe(),[i,o]=g.useState(""),[a,c]=g.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&i.trim().length===0,m=()=>{u?r(i.trim(),a):r(i.trim())};return l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:d}),l.jsx("button",{className:Ae.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ae.modalBody,children:u?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ae.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Ae.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:a,onChange:p=>c(Number(p.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":a}),l.jsx("span",{className:Ae.sliderValue,children:a})]}),l.jsxs("div",{className:Ae.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Ae.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Ae.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:i,onChange:p=>o(p.target.value),rows:4})]})]}):l.jsxs("div",{className:Ae.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Ae.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:i,onChange:p=>o(p.target.value),rows:5,required:!0,"aria-required":"true"}),i.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Ae.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(Re,{variant:u?"primary":"danger",onClick:m,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},U0=({message:e,onConfirm:t,onCancel:r})=>{const n=oe();return xr.createPortal(l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Ae.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Ae.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Ae.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Ph=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function z0(e,t={}){var c,u,d,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const s=e.includes("@"),i=/^\d{10,}$/.test(e.trim()),o={filters:n,fields:Ph,offset:0,limit:t.limit??200};return s?n.email=e.trim():i?n.phone=e.trim():o.query=e,((f=(d=(u=(await Fe.post("/action/user/v1/search",{request:o},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function V0(e){var r,n,s;return e.length?((s=(n=(r=(await Fe.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Ph,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:s.content)??[]:[]}async function H0(e){var r,n;return((n=(r=(await Fe.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const Q0="_container_1hnn8_1",W0="_header_1hnn8_13",G0="_title_1hnn8_22",K0="_closeBtn_1hnn8_29",Y0="_body_1hnn8_45",Z0="_label_1hnn8_54",X0="_searchSection_1hnn8_62",J0="_searchRow_1hnn8_68",eT="_searchInput_1hnn8_74",tT="_searchSpinner_1hnn8_89",rT="_resultsList_1hnn8_105",nT="_resultItem_1hnn8_118",sT="_userInfo_1hnn8_133",iT="_userName_1hnn8_141",oT="_userEmail_1hnn8_150",aT="_userOrg_1hnn8_158",lT="_noResults_1hnn8_167",cT="_collabSection_1hnn8_174",uT="_sectionTitle_1hnn8_179",dT="_badge_1hnn8_189",fT="_emptyCollab_1hnn8_203",hT="_collabList_1hnn8_214",pT="_collabItem_1hnn8_223",mT="_userAvatar_1hnn8_237",gT="_error_1hnn8_251",vT="_success_1hnn8_257",yT="_footer_1hnn8_263",Pe={container:Q0,header:W0,title:G0,closeBtn:K0,body:Y0,label:Z0,searchSection:X0,searchRow:J0,searchInput:eT,searchSpinner:tT,resultsList:rT,resultItem:nT,userInfo:sT,userName:iT,userEmail:oT,userOrg:aT,noResults:lT,collabSection:cT,sectionTitle:uT,badge:dT,emptyCollab:fT,collabList:hT,collabItem:pT,userAvatar:mT,error:gT,success:vT,footer:yT},bT=({contentId:e,onClose:t})=>{var j,P;const r=oe(),n=K(O=>O.editorConfig),s=(j=n==null?void 0:n.context)==null?void 0:j.channel,i=(P=n==null?void 0:n.config)==null?void 0:P.objectType,[o,a]=g.useState(""),[c,u]=g.useState([]),[d,f]=g.useState(!1),[m,p]=g.useState([]),[b,h]=g.useState(!1),[v,y]=g.useState(""),[C,S]=g.useState(!1),_=g.useRef(null);g.useEffect(()=>{let O=!1;return(async()=>{try{const N=await i0(e),R=(N==null?void 0:N.collaborators)??[];if(!R.length)return;const M=await V0(R);if(O)return;const $=R.map(ee=>M.find(H=>H.identifier===ee)??{identifier:ee,firstName:ee});p($)}catch{}})(),()=>{O=!0}},[e]),g.useEffect(()=>{_.current&&clearTimeout(_.current);const O=o.trim();if(O.length<2){u([]);return}return _.current=setTimeout(async()=>{f(!0);try{const N=await z0(O,{rootOrgId:s,objectType:i}),R=new Set(m.map(M=>M.identifier));u(N.filter(M=>!R.has(M.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{_.current&&clearTimeout(_.current)}},[o,m,s,i]);const x=g.useCallback(O=>{p(N=>N.find(R=>R.identifier===O.identifier)?N:[...N,O]),u(N=>N.filter(R=>R.identifier!==O.identifier)),S(!1)},[]),E=g.useCallback(O=>{p(N=>N.filter(R=>R.identifier!==O)),S(!1)},[]),D=g.useCallback(async()=>{h(!0),y(""),S(!1);try{await l0(e,m.map(O=>O.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{h(!1)}},[e,m,r.manageCollaborators.saveFailed]),T=O=>`${O.firstName}${O.lastName?` ${O.lastName}`:""}`;return l.jsxs("div",{className:Pe.container,children:[l.jsxs("div",{className:Pe.header,children:[l.jsx("h2",{className:Pe.title,children:r.manageCollaborators.title}),l.jsx("button",{className:Pe.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(br,{size:18})})]}),l.jsxs("div",{className:Pe.body,children:[l.jsxs("div",{className:Pe.searchSection,children:[l.jsx("label",{className:Pe.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:Pe.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:Pe.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:o,onChange:O=>a(O.target.value)}),d&&l.jsx("span",{className:Pe.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:Pe.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(O=>{var N,R,M,$;return l.jsxs("li",{className:Pe.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:T(O)}),O.email&&l.jsx("span",{className:Pe.userEmail,children:O.email}),(((R=(N=O.organisations)==null?void 0:N[0])==null?void 0:R.orgName)??O.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:(($=(M=O.organisations)==null?void 0:M[0])==null?void 0:$.orgName)??O.rootOrgName})]}),l.jsx(Re,{variant:"primary",size:"sm",onClick:()=>x(O),children:r.manageCollaborators.add})]},O.identifier)})}),o.trim().length>=2&&!d&&c.length===0&&l.jsx("p",{className:Pe.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:Pe.collabSection,children:[l.jsxs("h3",{className:Pe.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&l.jsx("span",{className:Pe.badge,children:m.length})]}),m.length===0?l.jsx("p",{className:Pe.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:Pe.collabList,children:m.map(O=>{var N,R,M,$;return l.jsxs("li",{className:Pe.collabItem,children:[l.jsx("div",{className:Pe.userAvatar,"aria-hidden":"true",children:T(O).charAt(0).toUpperCase()}),l.jsxs("div",{className:Pe.userInfo,children:[l.jsx("span",{className:Pe.userName,children:T(O)}),O.email&&l.jsx("span",{className:Pe.userEmail,children:O.email}),(((R=(N=O.organisations)==null?void 0:N[0])==null?void 0:R.orgName)??O.rootOrgName)&&l.jsx("span",{className:Pe.userOrg,children:(($=(M=O.organisations)==null?void 0:M[0])==null?void 0:$.orgName)??O.rootOrgName})]}),l.jsx(Re,{variant:"danger",size:"sm",onClick:()=>E(O.identifier),children:r.manageCollaborators.remove})]},O.identifier)})})]}),v&&l.jsx("p",{className:Pe.error,role:"alert",children:v}),C&&l.jsx("p",{className:Pe.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:Pe.footer,children:[l.jsx(Re,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx(Re,{variant:"primary",isLoading:b,onClick:D,children:r.manageCollaborators.save})]})]})};async function CT(e){return(await Fe.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function ST(e,t){var s;const n=((s=(await Fe.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:s.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function _T(e){var n;const r=((n=(await Fe.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const wT="_topbar_c3y0z_1",xT="_left_c3y0z_15",TT="_right_c3y0z_23",ET="_backBtn_c3y0z_30",AT="_title_c3y0z_49",kT="_profileBadge_c3y0z_61",IT="_statusChip_c3y0z_76",DT="_savedIndicator_c3y0z_88",LT="_unsaved_c3y0z_98",OT="_iconBtn_c3y0z_103",NT="_iconBtnLabel_c3y0z_130",jT="_qrDropdown_c3y0z_134",PT="_qrMenu_c3y0z_138",RT="_reviewBtns_c3y0z_173",FT="_sourcingBtns_c3y0z_182",MT="_modalOverlay_c3y0z_191",BT="_sbOverlay_c3y0z_201",qT="_sbModal_c3y0z_211",$T="_sbModalHeader_c3y0z_222",UT="_sbModalTitle_c3y0z_230",zT="_sbModalClose_c3y0z_237",VT="_sbModalBody_c3y0z_250",HT="_sbLabel_c3y0z_257",QT="_sbTextarea_c3y0z_264",WT="_sbError_c3y0z_281",GT="_sbModalFooter_c3y0z_288",_e={topbar:wT,left:xT,right:TT,backBtn:ET,title:AT,profileBadge:kT,statusChip:IT,savedIndicator:DT,unsaved:LT,iconBtn:OT,iconBtnLabel:NT,qrDropdown:jT,qrMenu:PT,reviewBtns:RT,sourcingBtns:FT,modalOverlay:MT,sbOverlay:BT,sbModal:qT,sbModalHeader:$T,sbModalTitle:UT,sbModalClose:zT,sbModalBody:VT,sbLabel:HT,sbTextarea:QT,sbError:WT,sbModalFooter:GT};function KT(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function YT(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const ZT=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:i,onCancel:o})=>{const a=oe(),[c,u]=g.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:`${d}-title`,className:_e.sbModalTitle,children:e}),l.jsx("button",{className:_e.sbModalClose,onClick:o,"aria-label":a.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:`${d}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${d}-comment`,className:_e.sbTextarea,placeholder:r,value:c,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:_e.sbError,children:a.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:o,children:a.reviewCommentModal.cancelButton}),l.jsx(Re,{variant:s,onClick:()=>i(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},XT=({onConfirm:e,onCancel:t})=>{const r=oe(),[n,s]=g.useState(!1),i=K(m=>m.editorProfile.key==="learningPath"),o=re(m=>m.treeData[0]),a=re(m=>m.treeCache),c=lr(),{scope:u}=ii(),d=i?Rl(o,c==null?void 0:c.code,u,a):[],f=d.length>0;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:_e.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:_e.sbModalBody,children:f?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:d.map((m,p)=>l.jsx("li",{children:m.message},`${m.code}-${m.nodeId??p}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:m=>s(m.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!f&&l.jsx(Re,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},JT=({onConfirm:e,onCancel:t})=>{const r=oe(),[n,s]=g.useState(""),i=parseInt(n,10),o=!isNaN(i)&&i>=2&&i<=250;return l.jsx("div",{className:_e.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:_e.sbModal,children:[l.jsxs("div",{className:_e.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:_e.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:_e.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:_e.sbModalBody,children:[l.jsxs("label",{className:_e.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:_e.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:a=>s(a.target.value)}),n&&!o&&l.jsx("p",{className:_e.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:_e.sbModalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(Re,{variant:"primary",onClick:()=>e(i),disabled:!o,children:r.generateQRModal.generateButton})]})]})})},e1=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:i})=>{var be,me;const o=oe(),c=re(le=>le.treeData)[0],u=(c==null?void 0:c.name)??o.contextualEditor.untitledPlaceholder,d=YT(((be=c==null?void 0:c.metadata)==null?void 0:be.status)??(c==null?void 0:c.status),o.topbar.draftStatusFallback),f=K(le=>{var ve,Te,Y,ce;return((Te=(ve=le.editorConfig)==null?void 0:ve.context)==null?void 0:Te.contentId)??((ce=(Y=le.editorConfig)==null?void 0:Y.context)==null?void 0:ce.identifier)??""}),{activeModal:m,modalData:p,closeModal:b,openModal:h}=yr(),v=K(le=>le.buttonLoaders),y=K(le=>le.categoryMeta),C=K(le=>le.editorProfile),S=C.key==="learningPath",_=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[x,E]=g.useState(!1),[D,T]=g.useState(!1),[j,P]=g.useState(!1),O=g.useRef(null),[N,R]=g.useState(!1);g.useEffect(()=>{if(!j)return;const le=ve=>{var Te;(Te=O.current)!=null&&Te.contains(ve.target)||P(!1)};return document.addEventListener("mousedown",le),()=>document.removeEventListener("mousedown",le)},[j]);const[M,$]=g.useState(!1),[ee,H]=g.useState(!1),{updateNode:te}=re(),de=(me=c==null?void 0:c.metadata)==null?void 0:me.qrCodeProcessId,fe=g.useCallback(async le=>{if(f){R(!1),$(!0);try{const{processId:ve,reservedDialcodes:Te}=await ST(f,le);ve&&c&&te(c.id,{qrCodeProcessId:ve,reservedDialcodes:Te}),Se.success(o.topbar.qrGenerationStartedToast)}catch{Se.error(o.topbar.qrGenerationFailedToast)}finally{$(!1)}}},[f,c,te,o]),pe=g.useCallback(async()=>{if(!de){Se.error(o.topbar.qrCodesNotGeneratedToast);return}H(!0);try{const le=await _T(de);if(le.status==="in-process"){Se(o.topbar.qrGenerationInProgressToast,{icon:l.jsx(Bn,{size:16})});return}const ve=le.url;if(!ve){Se.error(o.topbar.qrCodesNotReadyToast);return}const Te=await fetch(ve).then(We=>We.blob()),Y=await new Promise(We=>{const tt=new FileReader;tt.onloadend=()=>We(tt.result),tt.readAsDataURL(Te)}),ce=(c==null?void 0:c.metadata)??{},Q=We=>Array.isArray(We)?We.join("_"):typeof We=="string"?We:"",Ce=[f,Q(ce.medium),Q(ce.gradeLevel),Q(ce.subject)].filter(Boolean),qe=new Date().toISOString().replace(/[:.]/g,"-"),et=`${Ce.join("_")}_${qe}.zip`,$e=document.createElement("a");$e.href=Y,$e.download=et,$e.style.display="none",document.body.appendChild($e),$e.click(),document.body.removeChild($e),Se.success(o.topbar.qrCodesDownloadedToast)}catch{Se.error(o.topbar.qrCodesDownloadFailedToast)}finally{H(!1)}},[de,c,f,o]),ae=e==="edit",we=e==="review",ye=e==="sourcingreview",F=e==="read",B=g.useCallback((le,ve)=>{i({action:le,data:ve})},[i]),Z=g.useCallback(()=>{b(),B("publish")},[b,B]),he=g.useCallback((le,ve)=>{const Te=p==null?void 0:p.action;b(),Te==="approve"?B("sourcingApprove",{comment:le,score:ve}):B("reject",{comment:le})},[b,B,p]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:_e.topbar,role:"banner",children:[l.jsxs("div",{className:_e.left,children:[l.jsx("button",{className:_e.backBtn,onClick:()=>B("back"),"aria-label":o.topbar.backAriaLabel,type:"button",children:l.jsx(wl,{size:18})}),l.jsx("h1",{className:_e.title,title:u,children:u}),S&&l.jsxs("span",{className:_e.profileBadge,children:[l.jsx(Nh,{size:13,"aria-hidden":"true"}),o.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${_e.statusChip}`,"aria-label":`${o.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),l.jsxs("div",{className:_e.right,children:[t?l.jsx("span",{className:_e.savedIndicator,"aria-live":"polite",children:o.topbar.savingIndicator}):r&&ae?l.jsx("span",{className:`${_e.savedIndicator} ${_e.unsaved}`,"aria-live":"polite",children:o.topbar.unsavedIndicator}):n?l.jsxs("span",{className:_e.savedIndicator,"aria-live":"polite",children:[l.jsx(bn,{size:14,"aria-hidden":"true"}),o.topbar.savedIndicatorPrefix," ",KT(n)]}):null,!F&&!we&&!ye&&d!=="Review"&&l.jsx("span",{title:s?void 0:o.topbar.fillRequiredFieldsTooltip,children:l.jsx(Re,{variant:"ghost",size:"sm",onClick:()=>B("saveCollection"),disabled:!s,children:o.topbar.saveAsDraftButton})}),ae&&l.jsxs(l.Fragment,{children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>T(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx($y,{size:14,"aria-hidden":"true"})," ",o.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:_e.iconBtn,onClick:()=>h("manageCollaborators"),"aria-label":o.topbar.collaboratorsLabel,title:o.topbar.collaboratorsLabel,type:"button",children:l.jsx(Gy,{size:16,"aria-hidden":"true"})}),_&&l.jsxs("div",{className:_e.qrDropdown,ref:O,children:[l.jsxs("button",{className:_e.iconBtn,onClick:()=>P(le=>!le),"aria-label":o.topbar.qrCodesLabel,title:o.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":j,children:[l.jsx(Ac,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:_e.iconBtnLabel,children:o.topbar.qrCodesLabel}),l.jsx(Cn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),j&&l.jsxs("div",{className:_e.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{P(!1),R(!0)},disabled:M,children:[l.jsx(Ac,{size:14}),M?o.topbar.generatingEllipsis:o.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{P(!1),pe()},disabled:ee||!de,children:[l.jsx(Ay,{size:14}),ee?o.topbar.downloadingEllipsis:o.topbar.downloadQrCodesMenuItem]})]})]})]}),we&&l.jsxs("div",{className:_e.reviewBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(Rf,{size:14,"aria-hidden":"true"})," ",o.topbar.publishButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>E(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(kc,{size:14,"aria-hidden":"true"})," ",o.topbar.requestForChangesButton]})]}),ye&&l.jsxs("div",{className:_e.sourcingBtns,children:[l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"approve"}),children:[l.jsx(zy,{size:14,"aria-hidden":"true"})," ",o.topbar.approveButton]}),l.jsxs(Re,{variant:"primary",size:"sm",onClick:()=>h("qualityParams",{action:"reject"}),children:[l.jsx(kc,{size:14,"aria-hidden":"true"})," ",o.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&l.jsx(q0,{contentId:f,onConfirm:Z,onCancel:b}),m==="qualityParams"&&l.jsx($0,{contentId:f,action:(p==null?void 0:p.action)??"reject",onConfirm:he,onCancel:b}),m==="manageCollaborators"&&l.jsx("div",{className:_e.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(bT,{contentId:f,onClose:b})}),m==="confirmDelete"&&l.jsx(U0,{message:(p==null?void 0:p.message)??"",onConfirm:()=>{const le=p==null?void 0:p.onConfirm;b(),le==null||le()},onCancel:b}),D&&l.jsx(XT,{onConfirm:()=>{T(!1),B("sendForReview")},onCancel:()=>T(!1)}),x&&l.jsx(ZT,{titleText:o.topbar.requestChangesTitle,labelText:o.topbar.changesRequestedLabel,placeholderText:o.topbar.describeChangesPlaceholder,submitLabel:o.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:le=>{E(!1),B("reject",{comment:le})},onCancel:()=>E(!1)}),N&&l.jsx(JT,{onConfirm:fe,onCancel:()=>R(!1)})]})},t1=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=oe();return xr.createPortal(l.jsx("div",{className:Ae.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Ae.modal,children:[l.jsxs("div",{className:Ae.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Ae.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Ae.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Ae.modalFooter,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(Re,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(Re,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var r1=El();const Rh=g.createContext(null);function Ft(){const e=g.useContext(Rh);if(e===null)throw new Error("No Tree Api Provided");return e}const Fh=g.createContext(null);function n1(){const e=g.useContext(Fh);if(e===null)throw new Error("Provide a NodesContext");return e}const Mh=g.createContext(null);function s1(){const e=g.useContext(Mh);if(e===null)throw new Error("Provide a DnDContext");return e}const Bh=g.createContext(0);function qh(){g.useContext(Bh)}function Ni(e,t,r){return Math.max(Math.min(e,r),t)}function $h(e){return e&&e.isLeaf}function Uh(e){return e&&e.isInternal&&!e.isOpen}function zh(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Vh=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Hh=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function Fl(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=Fl(r,t);if(n)return n}return null}function eo(e,t){if(t(e),e.children)for(let r of e.children)eo(r,t)}function Qh(e){const t=Gh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=i1(t,n);break}r==null||r.focus()}function Wh(e){const t=Gh(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=o1(t,n);break}r==null||r.focus()}function i1(e,t){return t+1<e.length?e[t+1]:e[0]}function o1(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Gh(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function xs(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function Rn(e){return typeof e=="string"?e:e.id}function a1(e,...t){if(e)return e(...t)}function Kh(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function Yh(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function Zh(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const l1=Object.freeze(Object.defineProperty({__proto__:null,access:xs,bound:Ni,dfs:Fl,focusNextElement:Qh,focusPrevElement:Wh,getInsertIndex:Yh,getInsertParentId:Zh,identify:Rn,indexOf:Hh,isClosed:Uh,isDescendant:Vh,isItem:$h,isOpenWithEmptyChildren:zh,safeRun:a1,waitFor:Kh,walk:eo},Symbol.toStringTag,{value:"Module"})),c1={display:"flex",alignItems:"center",zIndex:1},u1={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},d1={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},f1=g.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},c1),s),children:[l.jsx("div",{style:Object.assign({},d1)}),l.jsx("div",{style:Object.assign({},u1)})]})});function h1({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function p1(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx(g1,Object.assign({},e)):l.jsx(m1,Object.assign({},e))]})}function m1(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function g1({node:e}){const t=g.useRef();return g.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const qs="__REACT_ARBORIST_INTERNAL_ROOT__";function ou(e){var t;function r(i,o,a){const c=e.accessId(i),u=new $s({tree:e,data:i,level:o,parent:a,id:c,children:null,isDraggable:e.isDraggable(i),rowIndex:null}),d=e.accessChildren(i);return d&&(u.children=d.map(f=>r(f,o+1,u))),u}const n=new $s({tree:e,id:qs,data:{id:qs},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(i=>r(i,0,n)),n}class $s{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===qs}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new $s(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Ko(e){return{type:"EDIT",id:e}}function v1(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function En(e){return{type:"FOCUS",id:e}}function y1(){return{type:"TREE_BLUR"}}function b1(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const Ya={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function au(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function C1(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:au(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:au(e.unfiltered,t)}):e}const rs=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},Ir={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:Rn(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(Rn)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(Rn)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:Rn(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:Rn(e)})};function S1(e=rs().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const ns={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function _1(e=rs().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return rs().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const w1={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},x1=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},T1=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function Xh({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(E1,{isDragging:s,children:[l.jsx(A1,{offset:e,children:l.jsx(I1,{id:r,dragIds:n})}),l.jsx(k1,{mouse:t,count:n.length})]})}const E1=g.memo(function(t){return t.isDragging?l.jsx("div",{style:w1,children:t.children}):null});function A1(e){return l.jsx("div",{className:"row preview",style:x1(e.offset),children:e.children})}function k1(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:T1(r),children:t}):null}const I1=g.memo(function(t){const r=Ft(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Za.apply(null,arguments)}function lu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Xa(e,t){return Xa=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Xa(e,t)}function D1(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xa(e,t)}var cu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function L1(e,t){return!!(e===t||cu(e)&&cu(t))}function O1(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!L1(e[r],t[r]))return!1;return!0}function Yo(e,t){t===void 0&&(t=O1);var r,n=[],s,i=!1;function o(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];return i&&r===this&&t(a,n)||(s=e.apply(this,a),i=!0,r=this,n=a),s}return o}var N1=typeof performance=="object"&&typeof performance.now=="function",uu=N1?function(){return performance.now()}:function(){return Date.now()};function du(e){cancelAnimationFrame(e.id)}function j1(e,t){var r=uu();function n(){uu()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var Zo=-1;function fu(e){if(e===void 0&&(e=!1),Zo===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),Zo=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return Zo}var An=null;function hu(e){if(e===void 0&&(e=!1),An===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?An="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?An="negative":An="positive-ascending"),document.body.removeChild(t),An}return An}process.env.NODE_ENV;var P1=150,R1=function(t,r){return t},ji=null,Pi=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(ji=new WeakSet,Pi=new WeakSet);function Jh(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,i=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,a=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=(function(f){D1(m,f);function m(b){var h;return h=f.call(this,b)||this,h._instanceProps=c(h.props,lu(h)),h._outerRef=void 0,h._resetIsScrollingTimeoutId=null,h.state={instance:lu(h),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof h.props.initialScrollOffset=="number"?h.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},h._callOnItemsRendered=void 0,h._callOnItemsRendered=Yo(function(v,y,C,S){return h.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),h._callOnScroll=void 0,h._callOnScroll=Yo(function(v,y,C){return h.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),h._getItemStyle=void 0,h._getItemStyle=function(v){var y=h.props,C=y.direction,S=y.itemSize,_=y.layout,x=h._getItemStyleCache(u&&S,u&&_,u&&C),E;if(x.hasOwnProperty(v))E=x[v];else{var D=r(h.props,v,h._instanceProps),T=s(h.props,v,h._instanceProps),j=C==="horizontal"||_==="horizontal",P=C==="rtl",O=j?D:0;x[v]=E={position:"absolute",left:P?void 0:O,right:P?O:void 0,top:j?0:D,height:j?"100%":T,width:j?T:"100%"}}return E},h._getItemStyleCache=void 0,h._getItemStyleCache=Yo(function(v,y,C){return{}}),h._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,_=y.scrollWidth;h.setState(function(x){if(x.scrollOffset===S)return null;var E=h.props.direction,D=S;if(E==="rtl")switch(hu()){case"negative":D=-S;break;case"positive-descending":D=_-C-S;break}return D=Math.max(0,Math.min(D,_-C)),{isScrolling:!0,scrollDirection:x.scrollOffset<D?"forward":"backward",scrollOffset:D,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,_=y.scrollTop;h.setState(function(x){if(x.scrollOffset===_)return null;var E=Math.max(0,Math.min(_,S-C));return{isScrolling:!0,scrollDirection:x.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},h._resetIsScrollingDebounced)},h._outerRefSetter=function(v){var y=h.props.outerRef;h._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},h._resetIsScrollingDebounced=function(){h._resetIsScrollingTimeoutId!==null&&du(h._resetIsScrollingTimeoutId),h._resetIsScrollingTimeoutId=j1(h._resetIsScrolling,P1)},h._resetIsScrolling=function(){h._resetIsScrollingTimeoutId=null,h.setState({isScrolling:!1},function(){h._getItemStyleCache(-1,null)})},h}m.getDerivedStateFromProps=function(h,v){return F1(h,v),d(h),null};var p=m.prototype;return p.scrollTo=function(h){h=Math.max(0,h),this.setState(function(v){return v.scrollOffset===h?null:{scrollDirection:v.scrollOffset<h?"forward":"backward",scrollOffset:h,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},p.scrollToItem=function(h,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,_=this.state.scrollOffset;h=Math.max(0,Math.min(h,C-1));var x=0;if(this._outerRef){var E=this._outerRef;S==="vertical"?x=E.scrollWidth>E.clientWidth?fu():0:x=E.scrollHeight>E.clientHeight?fu():0}this.scrollTo(i(this.props,h,v,_,this._instanceProps,x))},p.componentDidMount=function(){var h=this.props,v=h.direction,y=h.initialScrollOffset,C=h.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},p.componentDidUpdate=function(){var h=this.props,v=h.direction,y=h.layout,C=this.state,S=C.scrollOffset,_=C.scrollUpdateWasRequested;if(_&&this._outerRef!=null){var x=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(hu()){case"negative":x.scrollLeft=-S;break;case"positive-ascending":x.scrollLeft=S;break;default:var E=x.clientWidth,D=x.scrollWidth;x.scrollLeft=D-E-S;break}else x.scrollLeft=S;else x.scrollTop=S}this._callPropsCallbacks()},p.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&du(this._resetIsScrollingTimeoutId)},p.render=function(){var h=this.props,v=h.children,y=h.className,C=h.direction,S=h.height,_=h.innerRef,x=h.innerElementType,E=h.innerTagName,D=h.itemCount,T=h.itemData,j=h.itemKey,P=j===void 0?R1:j,O=h.layout,N=h.outerElementType,R=h.outerTagName,M=h.style,$=h.useIsScrolling,ee=h.width,H=this.state.isScrolling,te=C==="horizontal"||O==="horizontal",de=te?this._onScrollHorizontal:this._onScrollVertical,fe=this._getRangeToRender(),pe=fe[0],ae=fe[1],we=[];if(D>0)for(var ye=pe;ye<=ae;ye++)we.push(g.createElement(v,{data:T,key:P(ye,T),index:ye,isScrolling:$?H:void 0,style:this._getItemStyle(ye)}));var F=n(this.props,this._instanceProps);return g.createElement(N||R||"div",{className:y,onScroll:de,ref:this._outerRefSetter,style:Za({position:"relative",height:S,width:ee,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},M)},g.createElement(x||E||"div",{children:we,ref:_,style:{height:te?"100%":F,pointerEvents:H?"none":void 0,width:te?F:"100%"}}))},p._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var h=this.props.itemCount;if(h>0){var v=this._getRangeToRender(),y=v[0],C=v[1],S=v[2],_=v[3];this._callOnItemsRendered(y,C,S,_)}}if(typeof this.props.onScroll=="function"){var x=this.state,E=x.scrollDirection,D=x.scrollOffset,T=x.scrollUpdateWasRequested;this._callOnScroll(E,D,T)}},p._getRangeToRender=function(){var h=this.props,v=h.itemCount,y=h.overscanCount,C=this.state,S=C.isScrolling,_=C.scrollDirection,x=C.scrollOffset;if(v===0)return[0,0,0,0];var E=o(this.props,x,this._instanceProps),D=a(this.props,E,x,this._instanceProps),T=!S||_==="backward"?Math.max(1,y):1,j=!S||_==="forward"?Math.max(1,y):1;return[Math.max(0,E-T),Math.max(0,Math.min(v-1,D+j)),E,D]},m})(g.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var F1=function(t,r){var n=t.children,s=t.direction,i=t.height,o=t.layout,a=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(a!=null||c!=null)&&Pi&&!Pi.has(d)&&(Pi.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||o==="horizontal";switch(s){case"horizontal":case"vertical":ji&&!ji.has(d)&&(ji.add(d),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(o){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+o+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof i!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(i===null?"null":typeof i)+'" was specified.'))}},M1=50,Fn=function(t,r,n){var s=t,i=s.itemSize,o=n.itemMetadataMap,a=n.lastMeasuredIndex;if(r>a){var c=0;if(a>=0){var u=o[a];c=u.offset+u.size}for(var d=a+1;d<=r;d++){var f=i(d);o[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return o[r]},B1=function(t,r,n){var s=r.itemMetadataMap,i=r.lastMeasuredIndex,o=i>0?s[i].offset:0;return o>=n?ep(t,r,i,0,n):q1(t,r,Math.max(0,i),n)},ep=function(t,r,n,s,i){for(;s<=n;){var o=s+Math.floor((n-s)/2),a=Fn(t,o,r).offset;if(a===i)return o;a<i?s=o+1:a>i&&(n=o-1)}return s>0?s-1:0},q1=function(t,r,n,s){for(var i=t.itemCount,o=1;n<i&&Fn(t,n,r).offset<s;)n+=o,o*=2;return ep(t,r,Math.min(n,i-1),Math.floor(n/2),s)},pu=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,i=r.estimatedItemSize,o=r.lastMeasuredIndex,a=0;if(o>=n&&(o=n-1),o>=0){var c=s[o];a=c.offset+c.size}var u=n-o-1,d=u*i;return a+d},$1=Jh({getItemOffset:function(t,r,n){return Fn(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:pu,getOffsetForIndexAndAlignment:function(t,r,n,s,i,o){var a=t.direction,c=t.height,u=t.layout,d=t.width,f=a==="horizontal"||u==="horizontal",m=f?d:c,p=Fn(t,r,i),b=pu(t,i),h=Math.max(0,Math.min(b-m,p.offset)),v=Math.max(0,p.offset-m+p.size+o);switch(n==="smart"&&(s>=v-m&&s<=h+m?n="auto":n="center"),n){case"start":return h;case"end":return v;case"center":return Math.round(v+(h-v)/2);case"auto":default:return s>=v&&s<=h?s:s<v?v:h}},getStartIndexForOffset:function(t,r,n){return B1(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var i=t.direction,o=t.height,a=t.itemCount,c=t.layout,u=t.width,d=i==="horizontal"||c==="horizontal",f=d?u:o,m=Fn(t,r,s),p=n+f,b=m.offset+m.size,h=r;h<a-1&&b<p;)h++,b+=Fn(t,h,s).size;return h},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,i={itemMetadataMap:{},estimatedItemSize:s||M1,lastMeasuredIndex:-1};return r.resetAfterIndex=function(o,a){a===void 0&&(a=!0),i.lastMeasuredIndex=Math.min(i.lastMeasuredIndex,o-1),r._getItemStyleCache(-1),a&&r.forceUpdate()},i},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),U1=Jh({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,s,i,o){var a=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,m=t.width,p=a==="horizontal"||f==="horizontal",b=p?m:c,h=Math.max(0,u*d-b),v=Math.min(h,r*d),y=Math.max(0,r*d-b+d+o);switch(n==="smart"&&(s>=y-b&&s<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(b/2)?0:C>h+Math.floor(b/2)?h:C}case"auto":default:return s>=y&&s<=v?s:s<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,i=t.height,o=t.itemCount,a=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*a,m=d?u:i,p=Math.ceil((m+n-f)/a);return Math.max(0,Math.min(o-1,r+p-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function z1(){var e,t;const r=Ft(),s=s1().cursor;if(!s||s.type!=="line")return null;const i=r.indent,o=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),a=i*s.level,c=r.renderCursor;return l.jsx(c,{top:o,left:a,indent:i})}var V1=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const H1=g.forwardRef(function(t,r){const{children:n}=t,s=V1(t,["children"]),i=Ft();return l.jsxs("div",Object.assign({ref:r},s,{onClick:o=>{o.currentTarget===o.target&&i.deselectAll()},children:[l.jsx(Q1,{}),n]}))}),Q1=()=>{const e=Ft();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(z1,{})})};var W1=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const G1=g.forwardRef(function(t,r){var n,s,i,o,{style:a}=t,c=W1(t,["style"]);const u=Ft(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(o=(i=u.props.padding)!==null&&i!==void 0?i:u.props.paddingBottom)!==null&&o!==void 0?o:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},a),{height:`${parseFloat(a.height)+d+f}px`})},c))});var tp=g.createContext({dragDropManager:void 0}),Xt;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Xt||(Xt={}));function xe(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var i;if(t===void 0)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;i=new Error(t.replace(/%s/g,function(){return n[o++]})),i.name="Invariant Violation"}throw i.framesToPop=1,i}}var Ml="dnd-core/INIT_COORDS",ko="dnd-core/BEGIN_DRAG",Bl="dnd-core/PUBLISH_DRAG_SOURCE",Io="dnd-core/HOVER",Do="dnd-core/DROP",Lo="dnd-core/END_DRAG";function mu(e,t){return{type:Ml,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function Ri(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ri=function(r){return typeof r}:Ri=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Ri(e)}function K1(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function Y1(e,t){return e.filter(function(r){return r!==t})}function rp(e){return Ri(e)==="object"}function Z1(e,t){var r=new Map,n=function(o){r.set(o,r.has(o)?r.get(o)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i,o){i===1&&s.push(o)}),s}function X1(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var J1={type:Ml,payload:{clientOffset:null,sourceClientOffset:null}};function eE(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=n.publishSource,i=s===void 0?!0:s,o=n.clientOffset,a=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(mu(o)),tE(r,c,u);var d=sE(r,c);if(d===null){e.dispatch(J1);return}var f=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");rE(a),f=a(d)}e.dispatch(mu(o,f));var m=u.getSource(d),p=m.beginDrag(c,d);if(p!=null){nE(p),u.pinSource(d);var b=u.getSourceType(d);return{type:ko,payload:{itemType:b,item:p,sourceId:d,clientOffset:o||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}}}function tE(e,t,r){xe(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){xe(r.getSource(n),"Expected sourceIds to be registered.")})}function rE(e){xe(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function nE(e){xe(rp(e),"Item must be an object.")}function sE(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function iE(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:Bl}}}function Ja(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function oE(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;aE(r);var i=r.slice(0),o=e.getMonitor(),a=e.getRegistry();lE(i,o,a);var c=o.getItemType();return cE(i,a,c),uE(i,o,a),{type:Io,payload:{targetIds:i,clientOffset:s||null}}}}function aE(e){xe(Array.isArray(e),"Expected targetIds to be an array.")}function lE(e,t,r){xe(t.isDragging(),"Cannot call hover while not dragging."),xe(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];xe(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var i=r.getTarget(s);xe(i,"Expected targetIds to be registered.")}}function cE(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],i=t.getTargetType(s);Ja(i,r)||e.splice(n,1)}}function uE(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function vu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gu(Object(r),!0).forEach(function(n){dE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fE(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();hE(n);var i=gE(n);i.forEach(function(o,a){var c=pE(o,a,s,n),u={type:Do,payload:{dropResult:vu(vu({},r),c)}};e.dispatch(u)})}}function hE(e){xe(e.isDragging(),"Cannot call drop while not dragging."),xe(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function pE(e,t,r,n){var s=r.getTarget(e),i=s?s.drop(n,e):void 0;return mE(i),typeof i>"u"&&(i=t===0?{}:n.getDropResult()),i}function mE(e){xe(typeof e>"u"||rp(e),"Drop result must either be an object or undefined.")}function gE(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function vE(e){return function(){var r=e.getMonitor(),n=e.getRegistry();yE(r);var s=r.getSourceId();if(s!=null){var i=n.getSource(s,!0);i.endDrag(r,s),n.unpinSource()}return{type:Lo}}}function yE(e){xe(e.isDragging(),"Cannot call endDrag while not dragging.")}function bE(e){return{beginDrag:eE(e),publishDragSource:iE(e),hover:oE(e),drop:fE(e),endDrag:vE(e)}}function CE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _E(e,t,r){return t&&SE(e.prototype,t),e}function gs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wE=(function(){function e(t,r){var n=this;CE(this,e),gs(this,"store",void 0),gs(this,"monitor",void 0),gs(this,"backend",void 0),gs(this,"isSetUp",!1),gs(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return _E(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function s(o){return function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];var d=o.apply(r,c);typeof d<"u"&&n(d)}}var i=bE(this);return Object.keys(i).reduce(function(o,a){var c=i[a];return o[a]=s(c),o},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function Qt(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var yu=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),bu=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cu={INIT:"@@redux/INIT"+bu(),REPLACE:"@@redux/REPLACE"+bu()};function xE(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function TE(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(kE(e))return"date";if(AE(e))return"error";var r=EE(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function EE(e){return typeof e.constructor=="function"?e.constructor.name:null}function AE(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function kE(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=TE(e)),t}function np(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Qt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Qt(1):"Expected the enhancer to be a function. Instead, received: '"+kn(r)+"'");return r(np)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Qt(2):"Expected the root reducer to be a function. Instead, received: '"+kn(e)+"'");var s=e,i=t,o=[],a=o,c=!1;function u(){a===o&&(a=o.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Qt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function f(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Qt(4):"Expected the listener to be a function. Instead, received: '"+kn(h)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?Qt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return u(),a.push(h),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?Qt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,u();var C=a.indexOf(h);a.splice(C,1),o=null}}}function m(h){if(!xE(h))throw new Error(process.env.NODE_ENV==="production"?Qt(7):"Actions must be plain objects. Instead, the actual type was: '"+kn(h)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof h.type>"u")throw new Error(process.env.NODE_ENV==="production"?Qt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?Qt(9):"Reducers may not dispatch actions.");try{c=!0,i=s(i,h)}finally{c=!1}for(var v=o=a,y=0;y<v.length;y++){var C=v[y];C()}return h}function p(h){if(typeof h!="function")throw new Error(process.env.NODE_ENV==="production"?Qt(10):"Expected the nextReducer to be a function. Instead, received: '"+kn(h));s=h,m({type:Cu.REPLACE})}function b(){var h,v=f;return h={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?Qt(11):"Expected the observer to be an object. Instead, received: '"+kn(C)+"'");function S(){C.next&&C.next(d())}S();var _=v(S);return{unsubscribe:_}}},h[yu]=function(){return this},h}return m({type:Cu.INIT}),n={dispatch:m,subscribe:f,getState:d,replaceReducer:p},n[yu]=b,n}var IE=function(t,r){return t===r};function DE(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function LE(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IE;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function Su(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function _u(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Su(Object(r),!0).forEach(function(n){OE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Su(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wu={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function NE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:wu,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ml:case ko:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Io:return DE(e.clientOffset,r.clientOffset)?e:_u(_u({},e),{},{clientOffset:r.clientOffset});case Lo:case Do:return wu;default:return e}}var ql="dnd-core/ADD_SOURCE",$l="dnd-core/ADD_TARGET",Ul="dnd-core/REMOVE_SOURCE",Oo="dnd-core/REMOVE_TARGET";function jE(e){return{type:ql,payload:{sourceId:e}}}function PE(e){return{type:$l,payload:{targetId:e}}}function RE(e){return{type:Ul,payload:{sourceId:e}}}function FE(e){return{type:Oo,payload:{targetId:e}}}function xu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Wt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xu(Object(r),!0).forEach(function(n){ME(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ME(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var BE={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function qE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:BE,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case ko:return Wt(Wt({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case Bl:return Wt(Wt({},e),{},{isSourcePublic:!0});case Io:return Wt(Wt({},e),{},{targetIds:r.targetIds});case Oo:return e.targetIds.indexOf(r.targetId)===-1?e:Wt(Wt({},e),{},{targetIds:Y1(e.targetIds,r.targetId)});case Do:return Wt(Wt({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Lo:return Wt(Wt({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function $E(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ql:case $l:return e+1;case Ul:case Oo:return e-1;default:return e}}var to=[],zl=[];to.__IS_NONE__=!0;zl.__IS_ALL__=!0;function UE(e,t){if(e===to)return!1;if(e===zl||typeof t>"u")return!0;var r=X1(t,e);return r.length>0}function zE(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Io:break;case ql:case $l:case Oo:case Ul:return to;case ko:case Bl:case Lo:case Do:default:return zl}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,i=s===void 0?[]:s,o=Z1(n,i),a=o.length>0||!LE(n,i);if(!a)return to;var c=i[i.length-1],u=n[n.length-1];return c!==u&&(c&&o.push(c),u&&o.push(u)),o}function VE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function Tu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Eu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tu(Object(r),!0).forEach(function(n){HE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function HE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:zE(e.dirtyHandlerIds,{type:t.type,payload:Eu(Eu({},t.payload),{},{prevTargetIds:K1(e,"dragOperation.targetIds",[])})}),dragOffset:NE(e.dragOffset,t),refCount:$E(e.refCount,t),dragOperation:qE(e.dragOperation,t),stateId:VE(e.stateId)}}function WE(e,t){return{x:e.x+t.x,y:e.y+t.y}}function sp(e,t){return{x:e.x-t.x,y:e.y-t.y}}function GE(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:sp(WE(t,n),r)}function KE(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:sp(t,r)}function YE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function XE(e,t,r){return t&&ZE(e.prototype,t),e}function Au(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var JE=(function(){function e(t,r){YE(this,e),Au(this,"store",void 0),Au(this,"registry",void 0),this.store=t,this.registry=r}return XE(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},i=s.handlerIds;xe(typeof r=="function","listener must be a function."),xe(typeof i>"u"||Array.isArray(i),"handlerIds, when specified, must be an array of strings.");var o=this.store.getState().stateId,a=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===o||d===o+1&&!UE(u.dirtyHandlerIds,i);f||r()}finally{o=d}};return this.store.subscribe(a)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;xe(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,i=function(){var a=n.store.getState().dragOffset;a!==s&&(s=a,r())};return this.store.subscribe(i)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return xe(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(xe(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),i=this.getItemType();return Ja(s,i)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(xe(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),i=this.getItemType();return s!==i?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var s=n.shallow;if(!this.isDragging())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();if(o&&!Ja(i,o))return!1;var a=this.getTargetIds();if(!a.length)return!1;var c=a.indexOf(r);return s?c===a.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return GE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return KE(this.store.getState().dragOffset)}}]),e})(),eA=0;function tA(){return eA++}function Fi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fi=function(r){return typeof r}:Fi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Fi(e)}function rA(e){xe(typeof e.canDrag=="function","Expected canDrag to be a function."),xe(typeof e.beginDrag=="function","Expected beginDrag to be a function."),xe(typeof e.endDrag=="function","Expected endDrag to be a function.")}function nA(e){xe(typeof e.canDrop=="function","Expected canDrop to be a function."),xe(typeof e.hover=="function","Expected hover to be a function."),xe(typeof e.drop=="function","Expected beginDrag to be a function.")}function el(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return el(r,!1)});return}xe(typeof e=="string"||Fi(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const ku=typeof global<"u"?global:self,ip=ku.MutationObserver||ku.WebKitMutationObserver;function op(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function sA(e){let t=1;const r=new ip(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const iA=typeof ip=="function"?sA:op;class oA{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,s=t.length-this.index;n<s;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=iA(this.flush),this.requestErrorThrow=op(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class aA{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class lA{create(t){const r=this.freeTasks,n=r.length?r.pop():new aA(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const ap=new oA,cA=new lA(ap.registerPendingError);function uA(e){ap.enqueueTask(cA.create(e))}function dA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hA(e,t,r){return t&&fA(e.prototype,t),e}function In(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pA(e,t){return yA(e)||vA(e,t)||gA(e,t)||mA()}function mA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gA(e,t){if(e){if(typeof e=="string")return Iu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Iu(e,t)}}function Iu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function yA(e){if(Array.isArray(e))return e}function bA(e){var t=tA().toString();switch(e){case Xt.SOURCE:return"S".concat(t);case Xt.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function Du(e){switch(e[0]){case"S":return Xt.SOURCE;case"T":return Xt.TARGET;default:xe(!1,"Cannot parse handler ID: ".concat(e))}}function Lu(e,t){var r=e.entries(),n=!1;do{var s=r.next(),i=s.done,o=pA(s.value,2),a=o[1];if(a===t)return!0;n=!!i}while(!n);return!1}var CA=(function(){function e(t){dA(this,e),In(this,"types",new Map),In(this,"dragSources",new Map),In(this,"dropTargets",new Map),In(this,"pinnedSourceId",null),In(this,"pinnedSource",null),In(this,"store",void 0),this.store=t}return hA(e,[{key:"addSource",value:function(r,n){el(r),rA(n);var s=this.addHandler(Xt.SOURCE,r,n);return this.store.dispatch(jE(s)),s}},{key:"addTarget",value:function(r,n){el(r,!0),nA(n);var s=this.addHandler(Xt.TARGET,r,n);return this.store.dispatch(PE(s)),s}},{key:"containsHandler",value:function(r){return Lu(this.dragSources,r)||Lu(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;xe(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,i=s?this.pinnedSource:this.dragSources.get(r);return i}},{key:"getTarget",value:function(r){return xe(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return xe(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return xe(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=Du(r);return n===Xt.SOURCE}},{key:"isTargetId",value:function(r){var n=Du(r);return n===Xt.TARGET}},{key:"removeSource",value:function(r){var n=this;xe(this.getSource(r),"Expected an existing source."),this.store.dispatch(RE(r)),uA(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){xe(this.getTarget(r),"Expected an existing target."),this.store.dispatch(FE(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);xe(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){xe(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var i=bA(r);return this.types.set(i,n),r===Xt.SOURCE?this.dragSources.set(i,s):r===Xt.TARGET&&this.dropTargets.set(i,s),i}}]),e})();function SA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=_A(n),i=new JE(s,new CA(s)),o=new wE(s,i),a=e(o,t,r);return o.receiveBackend(a),o}function _A(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return np(QE,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var wA=["children"];function xA(e,t){return kA(e)||AA(e,t)||EA(e,t)||TA()}function TA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EA(e,t){if(e){if(typeof e=="string")return Ou(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ou(e,t)}}function Ou(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function AA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function kA(e){if(Array.isArray(e))return e}function IA(e,t){if(e==null)return{};var r=DA(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function DA(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var Nu=0,Mi=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),LA=g.memo(function(t){var r=t.children,n=IA(t,wA),s=OA(n),i=xA(s,2),o=i[0],a=i[1];return g.useEffect(function(){if(a){var c=lp();return++Nu,function(){--Nu===0&&(c[Mi]=null)}}},[]),l.jsx(tp.Provider,Object.assign({value:o},{children:r}),void 0)});function OA(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=NA(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function NA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lp(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[Mi]||(s[Mi]={dragDropManager:SA(e,t,r,n)}),s[Mi]}function lp(){return typeof global<"u"?global:window}function jA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function RA(e,t,r){return t&&PA(e.prototype,t),e}function ju(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Xo=!1,Jo=!1,FA=(function(){function e(t){jA(this,e),ju(this,"internalMonitor",void 0),ju(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return RA(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){xe(!Xo,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Xo=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Xo=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;xe(!Jo,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Jo=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Jo=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function MA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function BA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qA(e,t,r){return t&&BA(e.prototype,t),e}function Pu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ea=!1,$A=(function(){function e(t){MA(this,e),Pu(this,"internalMonitor",void 0),Pu(this,"targetId",null),this.internalMonitor=t.getMonitor()}return qA(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;xe(!ea,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return ea=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{ea=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function UA(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function zA(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!g.isValidElement(t)){var n=t;return e(n,r),n}var s=t;UA(s);var i=r?function(o){return e(o,r)}:e;return VA(s,i)}}function cp(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=zA(n);t[r]=function(){return s}}}),t}function Ru(e,t){typeof e=="function"?e(t):e.current=t}function VA(e,t){var r=e.ref;return xe(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?g.cloneElement(e,{ref:function(s){Ru(r,s),Ru(t,s)}}):g.cloneElement(e,{ref:t})}function Bi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Bi=function(r){return typeof r}:Bi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Bi(e)}function tl(e){return e!==null&&Bi(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function rl(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<i.length;c++){var u=i[c];if(!a(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function HA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function QA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function WA(e,t,r){return t&&QA(e.prototype,t),e}function _t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var GA=(function(){function e(t){var r=this;HA(this,e),_t(this,"hooks",cp({dragSource:function(s,i){r.clearDragSource(),r.dragSourceOptions=i||null,tl(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,i){r.clearDragPreview(),r.dragPreviewOptions=i||null,tl(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),_t(this,"handlerId",null),_t(this,"dragSourceRef",null),_t(this,"dragSourceNode",void 0),_t(this,"dragSourceOptionsInternal",null),_t(this,"dragSourceUnsubscribe",void 0),_t(this,"dragPreviewRef",null),_t(this,"dragPreviewNode",void 0),_t(this,"dragPreviewOptionsInternal",null),_t(this,"dragPreviewUnsubscribe",void 0),_t(this,"lastConnectedHandlerId",null),_t(this,"lastConnectedDragSource",null),_t(this,"lastConnectedDragSourceOptions",null),_t(this,"lastConnectedDragPreview",null),_t(this,"lastConnectedDragPreviewOptions",null),_t(this,"backend",void 0),this.backend=t}return WA(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!rl(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!rl(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function KA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function YA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ZA(e,t,r){return t&&YA(e.prototype,t),e}function dr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var XA=(function(){function e(t){var r=this;KA(this,e),dr(this,"hooks",cp({dropTarget:function(s,i){r.clearDropTarget(),r.dropTargetOptions=i,tl(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),dr(this,"handlerId",null),dr(this,"dropTargetRef",null),dr(this,"dropTargetNode",void 0),dr(this,"dropTargetOptionsInternal",null),dr(this,"unsubscribeDropTarget",void 0),dr(this,"lastConnectedHandlerId",null),dr(this,"lastConnectedDropTarget",null),dr(this,"lastConnectedDropTargetOptions",null),dr(this,"backend",void 0),this.backend=t}return ZA(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!rl(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function JA(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function ek(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var yn=typeof window<"u"?g.useLayoutEffect:g.useEffect;function qi(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qi=function(r){return typeof r}:qi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},qi(e)}function tk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nk(e,t,r){return t&&rk(e.prototype,t),e}function ta(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sk=(function(){function e(t,r,n){tk(this,e),ta(this,"spec",void 0),ta(this,"monitor",void 0),ta(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return nk(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,i=null;return qi(n.item)==="object"?i=n.item:typeof n.item=="function"?i=n.item(s):i={},(r=i)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var s=this.spec,i=this.monitor,o=s.isDragging;return o?o(i):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,i=r.end;i&&i(n.getItem(),n),s.reconnect()}}]),e})();function ik(e,t,r){var n=g.useMemo(function(){return new sk(e,t,r)},[t,r]);return g.useEffect(function(){n.spec=e},[e]),n}function _n(){var e=g.useContext(tp),t=e.dragDropManager;return xe(t!=null,"Expected drag drop context"),t}function ok(e){return g.useMemo(function(){var t=e.type;return xe(t!=null,"spec.type must be defined"),t},[e])}function ak(e,t){return dk(e)||uk(e,t)||ck(e,t)||lk()}function lk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ck(e,t){if(e){if(typeof e=="string")return Fu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fu(e,t)}}function Fu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function uk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function dk(e){if(Array.isArray(e))return e}function fk(e,t,r){var n=_n(),s=ik(e,t,r),i=ok(e);yn(function(){if(i!=null){var a=ek(i,s,n),c=ak(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,i])}function hk(e){return vk(e)||gk(e)||mk(e)||pk()}function pk(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mk(e,t){if(e){if(typeof e=="string")return nl(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nl(e,t)}}function gk(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function vk(e){if(Array.isArray(e))return nl(e)}function nl(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function up(e,t){var r=hk(t||[]);return t==null&&typeof e!="function"&&r.push(e),g.useMemo(function(){return typeof e=="function"?e():e},r)}function yk(){var e=_n();return g.useMemo(function(){return new FA(e)},[e])}function bk(e,t){var r=_n(),n=g.useMemo(function(){return new GA(r.getBackend())},[r]);return yn(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),yn(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var ra,Mu;function Ck(){return Mu||(Mu=1,ra=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,i;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[s]))return!1;for(s=n;s--!==0;){var o=i[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),ra}var Sk=Ck();const _k=Tl(Sk);function wk(e,t){return Ak(e)||Ek(e,t)||Tk(e,t)||xk()}function xk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tk(e,t){if(e){if(typeof e=="string")return Bu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bu(e,t)}}function Bu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ek(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function Ak(e){if(Array.isArray(e))return e}function dp(e,t,r){var n=g.useState(function(){return t(e)}),s=wk(n,2),i=s[0],o=s[1],a=g.useCallback(function(){var c=t(e);_k(i,c)||(o(c),r&&r())},[i,e,r]);return yn(a),[i,a]}function kk(e,t){return Ok(e)||Lk(e,t)||Dk(e,t)||Ik()}function Ik(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dk(e,t){if(e){if(typeof e=="string")return qu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qu(e,t)}}function qu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function Ok(e){if(Array.isArray(e))return e}function Nk(e,t,r){var n=dp(e,t,r),s=kk(n,2),i=s[0],o=s[1];return yn(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(o,{handlerIds:[c]})},[e,o]),i}function fp(e,t,r){return Nk(t,e||function(){return{}},function(){return r.reconnect()})}function jk(e){return g.useMemo(function(){return e.hooks.dragSource()},[e])}function Pk(e){return g.useMemo(function(){return e.hooks.dragPreview()},[e])}function Rk(e,t){var r=up(e,t);xe(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=yk(),s=bk(r.options,r.previewOptions);return fk(r,n,s),[fp(r.collect,n,s),jk(s),Pk(s)]}function Fk(e){var t=e.accept;return g.useMemo(function(){return xe(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function Mk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qk(e,t,r){return t&&Bk(e.prototype,t),e}function $u(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var $k=(function(){function e(t,r){Mk(this,e),$u(this,"spec",void 0),$u(this,"monitor",void 0),this.spec=t,this.monitor=r}return qk(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function Uk(e,t){var r=g.useMemo(function(){return new $k(e,t)},[t]);return g.useEffect(function(){r.spec=e},[e]),r}function zk(e,t){return Wk(e)||Qk(e,t)||Hk(e,t)||Vk()}function Vk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hk(e,t){if(e){if(typeof e=="string")return Uu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uu(e,t)}}function Uu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Qk(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function Wk(e){if(Array.isArray(e))return e}function Gk(e,t,r){var n=_n(),s=Uk(e,t),i=Fk(e);yn(function(){var a=JA(i,s,n),c=zk(a,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,i.map(function(o){return o.toString()}).join("|")])}function Kk(){var e=_n();return g.useMemo(function(){return new $A(e)},[e])}function Yk(e){var t=_n(),r=g.useMemo(function(){return new XA(t.getBackend())},[t]);return yn(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function Zk(e){return g.useMemo(function(){return e.hooks.dropTarget()},[e])}function hp(e,t){var r=up(e,t),n=Kk(),s=Yk(r.options);return Gk(r,n,s),[fp(r.collect,n,s),Zk(s)]}function Xk(e,t){return rI(e)||tI(e,t)||eI(e,t)||Jk()}function Jk(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eI(e,t){if(e){if(typeof e=="string")return zu(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zu(e,t)}}function zu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,i=!1,o,a;try{for(r=r.call(e);!(s=(o=r.next()).done)&&(n.push(o.value),!(t&&n.length===t));s=!0);}catch(c){i=!0,a=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw a}}return n}}function rI(e){if(Array.isArray(e))return e}function nI(e){var t=_n(),r=t.getMonitor(),n=dp(r,e),s=Xk(n,2),i=s[0],o=s[1];return g.useEffect(function(){return r.subscribeToOffsetChange(o)}),g.useEffect(function(){return r.subscribeToStateChange(o)}),i}function pp(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function sI(e,t){return e.filter(function(r){return r!==t})}function iI(e,t){var r=new Set,n=function(o){return r.add(o)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(i){return s.push(i)}),s}function oI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function lI(e,t,r){return t&&aI(e.prototype,t),e}function Vu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var cI=(function(){function e(t){oI(this,e),Vu(this,"entered",[]),Vu(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return lI(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,i=function(a){return n.isNodeInDocument(a)&&(!a.contains||a.contains(r))};return this.entered=iI(this.entered.filter(i),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=sI(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),uI=pp(function(){return/firefox/i.test(navigator.userAgent)}),mp=pp(function(){return!!window.safari});function dI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hI(e,t,r){return t&&fI(e.prototype,t),e}function vs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Hu=(function(){function e(t,r){dI(this,e),vs(this,"xs",void 0),vs(this,"ys",void 0),vs(this,"c1s",void 0),vs(this,"c2s",void 0),vs(this,"c3s",void 0);for(var n=t.length,s=[],i=0;i<n;i++)s.push(i);s.sort(function(T,j){return t[T]<t[j]?-1:1});for(var o=[],a=[],c,u,d=0;d<n-1;d++)c=t[d+1]-t[d],u=r[d+1]-r[d],o.push(c),a.push(u/c);for(var f=[a[0]],m=0;m<o.length-1;m++){var p=a[m],b=a[m+1];if(p*b<=0)f.push(0);else{c=o[m];var h=o[m+1],v=c+h;f.push(3*v/((v+h)/p+(v+c)/b))}}f.push(a[a.length-1]);for(var y=[],C=[],S,_=0;_<f.length-1;_++){S=a[_];var x=f[_],E=1/o[_],D=x+f[_+1]-S-S;y.push((S-x-D)*E),C.push(D*E*E)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return hI(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,i=this.c1s,o=this.c2s,a=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var u=0,d=a.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var m=n[f];if(m<r)u=f+1;else if(m>r)d=f-1;else return s[f]}c=Math.max(0,d);var p=r-n[c],b=p*p;return s[c]+i[c]*p+o[c]*b+a[c]*p*b}}]),e})(),pI=1;function gp(e){var t=e.nodeType===pI?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function vi(e){return{x:e.clientX,y:e.clientY}}function mI(e){var t;return e.nodeName==="IMG"&&(uI()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function gI(e,t,r,n){var s=e?t.width:r,i=e?t.height:n;return mp()&&e&&(i/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:i}}function vI(e,t,r,n,s){var i=mI(t),o=i?e:t,a=gp(o),c={x:r.x-a.x,y:r.y-a.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,m=n.anchorY,p=gI(i,t,u,d),b=p.dragPreviewWidth,h=p.dragPreviewHeight,v=function(){var D=new Hu([0,.5,1],[c.y,c.y/d*h,c.y+h-d]),T=D.interpolate(m);return mp()&&i&&(T+=(window.devicePixelRatio-1)*h),T},y=function(){var D=new Hu([0,.5,1],[c.x,c.x/u*b,c.x+b-u]);return D.interpolate(f)},C=s.offsetX,S=s.offsetY,_=C===0||C,x=S===0||S;return{x:_?C:y(),y:x?S:v()}}var vp="__NATIVE_FILE__",yp="__NATIVE_URL__",bp="__NATIVE_TEXT__",Cp="__NATIVE_HTML__";const Qu=Object.freeze(Object.defineProperty({__proto__:null,FILE:vp,HTML:Cp,TEXT:bp,URL:yp},Symbol.toStringTag,{value:"Module"}));function na(e,t,r){var n=t.reduce(function(s,i){return s||e.getData(i)},"");return n??r}var Dn;function yi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var sl=(Dn={},yi(Dn,vp,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),yi(Dn,Cp,{exposeProperties:{html:function(t,r){return na(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),yi(Dn,yp,{exposeProperties:{urls:function(t,r){return na(t,r,"").split(`
545
- `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),yi(Dn,bp,{exposeProperties:{text:function(t,r){return na(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Dn);function yI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function CI(e,t,r){return t&&bI(e.prototype,t),e}function Wu(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var SI=(function(){function e(t){yI(this,e),Wu(this,"item",void 0),Wu(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return CI(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var s={};Object.keys(this.config.exposeProperties).forEach(function(i){s[i]={value:n.config.exposeProperties[i](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function _I(e,t){var r=new SI(sl[e]);return r.loadDataTransfer(t),r}function sa(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(sl).filter(function(r){var n=sl[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function wI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function TI(e,t,r){return t&&xI(e.prototype,t),e}function ia(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EI=(function(){function e(t,r){wI(this,e),ia(this,"ownerDocument",null),ia(this,"globalContext",void 0),ia(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return TI(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function Gu(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ku(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gu(Object(r),!0).forEach(function(n){Ie(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gu(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function II(e,t,r){return t&&kI(e.prototype,t),e}function Ie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var DI=(function(){function e(t,r,n){var s=this;AI(this,e),Ie(this,"options",void 0),Ie(this,"actions",void 0),Ie(this,"monitor",void 0),Ie(this,"registry",void 0),Ie(this,"enterLeaveCounter",void 0),Ie(this,"sourcePreviewNodes",new Map),Ie(this,"sourcePreviewNodeOptions",new Map),Ie(this,"sourceNodes",new Map),Ie(this,"sourceNodeOptions",new Map),Ie(this,"dragStartSourceIds",null),Ie(this,"dropTargetIds",[]),Ie(this,"dragEnterTargetIds",[]),Ie(this,"currentNativeSource",null),Ie(this,"currentNativeHandle",null),Ie(this,"currentDragSourceNode",null),Ie(this,"altKeyPressed",!1),Ie(this,"mouseMoveTimeoutTimer",null),Ie(this,"asyncEndDragFrameId",null),Ie(this,"dragOverTargetIds",null),Ie(this,"lastClientOffset",null),Ie(this,"hoverRafId",null),Ie(this,"getSourceClientOffset",function(i){var o=s.sourceNodes.get(i);return o&&gp(o)||null}),Ie(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),Ie(this,"isNodeInDocument",function(i){return!!(i&&s.document&&s.document.body&&s.document.body.contains(i))}),Ie(this,"endDragIfSourceWasRemovedFromDOM",function(){var i=s.currentDragSourceNode;i==null||s.isNodeInDocument(i)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),Ie(this,"handleTopDragStart",function(i){if(!i.defaultPrevented){var o=s.dragStartSourceIds;s.dragStartSourceIds=null;var a=vi(i);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(o||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:a});var c=i.dataTransfer,u=sa(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),m=s.sourcePreviewNodes.get(d)||f;if(m){var p=s.getCurrentSourcePreviewNodeOptions(),b=p.anchorX,h=p.anchorY,v=p.offsetX,y=p.offsetY,C={anchorX:b,anchorY:h},S={offsetX:v,offsetY:y},_=vI(f,m,a,C,S);c.setDragImage(m,_.x,_.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(i.target);var x=s.getCurrentSourcePreviewNodeOptions(),E=x.captureDraggingState;E?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}}}),Ie(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleTopDragEnterCapture",function(i){s.dragEnterTargetIds=[];var o=s.enterLeaveCounter.enter(i.target);if(!(!o||s.monitor.isDragging())){var a=i.dataTransfer,c=sa(a);c&&s.beginDragNativeItem(c,a)}}),Ie(this,"handleTopDragEnter",function(i){var o=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=i.altKey,o.length>0&&s.actions.hover(o,{clientOffset:vi(i)});var a=o.some(function(c){return s.monitor.canDropOnTarget(c)});a&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),Ie(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),Ie(this,"handleTopDragOver",function(i){var o=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}s.altKeyPressed=i.altKey,s.lastClientOffset=vi(i),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(o||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var a=(o||[]).some(function(c){return s.monitor.canDropOnTarget(c)});a?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))}),Ie(this,"handleTopDragLeaveCapture",function(i){s.isDraggingNativeItem()&&i.preventDefault();var o=s.enterLeaveCounter.leave(i.target);o&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),Ie(this,"handleTopDropCapture",function(i){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var o;i.preventDefault(),(o=s.currentNativeSource)===null||o===void 0||o.loadDataTransfer(i.dataTransfer)}else sa(i.dataTransfer)&&i.preventDefault();s.enterLeaveCounter.reset()}),Ie(this,"handleTopDrop",function(i){var o=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(o,{clientOffset:vi(i)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),Ie(this,"handleSelectStart",function(i){var o=i.target;typeof o.dragDrop=="function"&&(o.tagName==="INPUT"||o.tagName==="SELECT"||o.tagName==="TEXTAREA"||o.isContentEditable||(i.preventDefault(),o.dragDrop()))}),this.options=new EI(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new cI(this.isNodeInDocument)}return II(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,s){var i=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){i.sourcePreviewNodes.delete(r),i.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var i=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var o=function(u){return i.handleDragStart(u,r)},a=function(u){return i.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",o),n.addEventListener("selectstart",a),function(){i.sourceNodes.delete(r),i.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",o),n.removeEventListener("selectstart",a),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,i=function(u){return s.handleDragEnter(u,r)},o=function(u){return s.handleDragOver(u,r)},a=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",i),n.addEventListener("dragover",o),n.addEventListener("drop",a),function(){n.removeEventListener("dragenter",i),n.removeEventListener("dragover",o),n.removeEventListener("drop",a)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Ku({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Ku({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Qu).some(function(n){return Qu[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=_I(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var i;return(i=n.rootElement)===null||i===void 0?void 0:i.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),bi;function LI(){return bi||(bi=new Image,bi.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),bi}var OI=function(t,r,n){return new DI(t,r,n)};function NI(e,t){return typeof e=="function"?e(t):e??"NODE"}function jI(e){return e.isDraggable&&!e.isEditing}function PI(e){const t=Ft(),r=t.selectedIds,[n,s,i]=Rk(()=>({canDrag:()=>jI(e),type:NI(t.props.dragType,e),item:()=>{const o=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(ns.dragStart(e.id,o)),{id:e.id,dragIds:o,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(ns.dragEnd())}}),[r,e,t.props.dragType]);return g.useEffect(()=>{i(LI())},[i]),s}function RI(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),i=r.height,o=s<i/2,a=!o,c=i/4,u=s>c&&s<i-c;return{x:n,inTopHalf:o,inBottomHalf:a,inMiddle:u,atTop:!u&&o,atBottom:!u&&a}}function FI(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function Ci(e,t){return{parentId:e||null,index:t}}function Ln(e,t){return{type:"line",index:e,level:t}}function MI(e){return{type:"highlight",id:e}}function oa(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,i=Hh(n)+1;return{parentId:s,index:i}}function Sp(e){var t;const r=RI(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:i,nextNode:o,prevNode:a}=e,[c,u]=FI(i,a,o,r);if(i&&i.isInternal&&r.inMiddle)return{drop:Ci(i.id,null),cursor:MI(i.id)};if(!c)return{drop:Ci((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Ln(0,0)};if($h(c)){const d=Ni(s,(u==null?void 0:u.level)||0,c.level);return{drop:oa(c,d),cursor:Ln(c.rowIndex+1,d)}}if(Uh(c)){const d=Ni(s,(u==null?void 0:u.level)||0,c.level);return{drop:oa(c,d),cursor:Ln(c.rowIndex+1,d)}}if(zh(c)){const d=Ni(s,0,c.level+1);return d>c.level?{drop:Ci(c.id,0),cursor:Ln(c.rowIndex+1,d)}:{drop:oa(c,d),cursor:Ln(c.rowIndex+1,d)}}return{drop:Ci(c==null?void 0:c.id,0),cursor:Ln(c.rowIndex+1,c.level+1)}}function BI(e,t){const r=Ft(),[n,s]=hp(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(i,o)=>{const a=o.getClientOffset();if(!e.current||!a)return;const{cursor:c,drop:u}=Sp({element:e.current,offset:a,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(ns.hovering(u.parentId,u.index)),o.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(i,o)=>{if(!o.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function qI(e){const t=Ft(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return g.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Yu=g.memo(function({index:t,style:r}){qh(),n1();const n=Ft(),s=qI(t),i=g.useRef(null),o=PI(s),a=BI(i,s),c=g.useCallback(h=>{i.current=h,a(h)},[a]),u=n.indent*s.level,d=g.useMemo(()=>({paddingLeft:u}),[u]),f=g.useMemo(()=>{var h,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(h=n.props.padding)!==null&&h!==void 0?h:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};g.useEffect(()=>{var h;!s.isEditing&&s.isFocused&&((h=i.current)===null||h===void 0||h.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,i.current]);const p=n.renderNode,b=n.renderRow;return l.jsx(b,{node:s,innerRef:c,attrs:m,children:l.jsx(p,{node:s,tree:n,style:d,dragHandle:o})})});let aa="",Zu=null;function _p(){qh();const e=Ft();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const s=Array.from(e.selectedIds);if(s.length>1){let i=e.mostRecentNode;for(;i&&i.isSelected;)i=i.nextSibling;i||(i=e.lastNode),e.focus(i,{scroll:!1}),e.delete(Array.from(s))}else{const i=e.focusedNode;if(i){const o=i.nextSibling,a=i.parent;e.focus(o||a,{scroll:!1}),e.delete(i)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Qh(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Wh(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const i=e.focusedNode;i?i.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const i=e.focusedNode;i?i.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(Zu),aa+=t.key,Zu=setTimeout(()=>{aa=""},600);const n=e.visibleNodes.find(s=>{const i=s.data.name;return typeof i=="string"?i.toLowerCase().startsWith(aa):!1});n&&e.focus(n.id)},children:l.jsx($I,{})})}function $I(){var e,t;const r=Ft(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var i;return((i=r.visibleNodes[s])===null||i===void 0?void 0:i.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:H1,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:G1,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx($1,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Yu})):l.jsx(U1,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Yu}))}function Xu(e){return e.isFiltered?zI(e.root,e.isMatch.bind(e)):UI(e.root)}function UI(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(wp),t}function zI(e,t){const r={},n=[];function s(o){if(!o.isRoot&&t(o)){r[o.id]=!0;let c=o.parent;for(;c;)r[c.id]=!0,c=c.parent}if(o.children)for(let c of o.children)s(c)}function i(o){var a;o.level>=0&&r[o.id]&&n.push(o),o.isOpen&&((a=o.children)===null||a===void 0||a.forEach(i))}return s(e),i(e),n.forEach(wp),n}function wp(e,t){e.rowIndex=t}const Ju=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var la=function(e,t,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(d){try{u(n.next(d))}catch(f){o(f)}}function c(d){try{u(n.throw(d))}catch(f){o(f)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:wt}=l1;class Is{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=i=>{const o=this.props.rowHeight;if(typeof o=="function"){const a=this.at(i);return a?o(a):this.rowHeight}return o??24},this.rowTopPosition=i=>{if(typeof this.props.rowHeight!="function")return i*this.rowHeight;const o=this.getRowOffsets(),a=Math.max(0,Math.min(i,o.length-1));return o[a]},this.redrawList=(i=0)=>{this.rowOffsets=null;const o=this.list.current;o&&"resetAfterIndex"in o&&o.resetAfterIndex(Math.max(0,i))},this.root=ou(this),this.visibleNodes=Xu(this),this.idToIndex=Ju(this.visibleNodes)}update(t){this.props=t,this.root=ou(this),this.visibleNodes=Xu(this),this.idToIndex=Ju(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=xs(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=xs(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof $s)return t.id;const r=this.props.idAccessor||"id";return xs(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,i=this.indexOf(r);if(i===null)return[];const o=Math.min(s,i),a=Math.max(s,i);return this.visibleNodes.slice(o,a+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return la(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?Zh(this):t.parentId,i=(r=t.index)!==null&&r!==void 0?r:Yh(this),o=(n=t.type)!==null&&n!==void 0?n:"leaf",a=yield wt(this.props.onCreate,{type:o,parentId:s,index:i,parentNode:this.get(s)});a&&(this.focus(a),setTimeout(()=>{this.edit(a).then(()=>{this.select(a),this.activate(a)})}))})}delete(t){return la(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(o=>this.identify(o)),s=n.map(o=>this.get(o)).filter(o=>!!o),i=s.length?Math.min(...s.map(o=>{var a;return(a=o.rowIndex)!==null&&a!==void 0?a:0})):0;yield wt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(i)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Ko(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(i=>{Is.editPromise=i})}submit(t,r){return la(this,void 0,void 0,function*(){var n,s;if(!t)return;const i=this.identify(t);yield wt(this.props.onRename,{id:i,name:r,node:this.get(i)}),this.dispatch(Ko(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ko(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&wt(this.props.onActivate,r)}resolveEdit(t){const r=Is.editPromise;r&&r(t),Is.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(En(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&wt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,i=this.visibleStopIndex-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o>n?o=n:o=Math.max(n-i,0),this.focus(this.at(o))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,i=s-n;let o=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;o<s?o=s:o=Math.min(o+i,this.visibleNodes.length-1),this.focus(this.at(o))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,i=this.identify(t);s&&this.dispatch(En(i)),!((n=this.get(i))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[i],anchor:i,mostRecent:i}),this.scrollTo(i,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(Ir.remove(r)),wt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch(En(n.id)),n.isSelectable&&(this.dispatch(Ir.add(n.id)),this.dispatch(Ir.anchor(n.id)),this.dispatch(Ir.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(En(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:i}=this.state.nodes.selection,o=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(Ir.remove(this.nodesBetween(s,i))),this.dispatch(Ir.add(o)),this.dispatch(Ir.mostRecent(n))}this.scrollTo(n),this.focusedNode&&wt(this.props.onFocus,this.focusedNode),wt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch(En((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&wt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(o=>this.identify(o))),s=this.identifyNull(t.anchor),i=this.identifyNull(t.mostRecent);this.dispatch(Ir.set({ids:n,anchor:s,mostRecent:i})),wt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,s=this.props.disableDrop;for(const i of n)if(!i||!r||i.isInternal&&Vh(r,i))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;wt(this.props.onMove,{dragIds:n,parentId:t===qs?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(ns.cursor({type:"none"}))}showCursor(t){this.dispatch(ns.cursor(t))}open(t,r=!0){var n,s;const i=this.identifyNull(t);i&&(this.isOpen(i)||(this.dispatch(Ya.open(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,i)))}close(t,r=!0){var n,s;const i=this.identifyNull(t);i&&this.isOpen(i)&&(this.dispatch(Ya.close(i,this.isFiltered)),r&&this.redrawList((s=(n=this.get(i))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),wt(this.props.onToggle,i))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=Fl(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){eo(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){eo(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Kh(()=>n in this.idToIndex).then(()=>{var s;const i=this.idToIndex[n];i!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(i,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,s;if(!t)return!1;if(t===qs)return!0;const i=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:i}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!xs(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(En(t.id))}onBlur(){this.dispatch(y1())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||_p}get renderRow(){return this.props.renderRow||h1}get renderNode(){return this.props.children||p1}get renderDragPreview(){return this.props.renderDragPreview||Xh}get renderCursor(){return this.props.renderCursor||f1}}function xt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var VI=typeof Symbol=="function"&&Symbol.observable||"@@observable",ed=VI,ca=()=>Math.random().toString(36).substring(7).split("").join("."),HI={INIT:`@@redux/INIT${ca()}`,REPLACE:`@@redux/REPLACE${ca()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ca()}`},pn=HI;function xp(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function QI(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(KI(e))return"date";if(GI(e))return"error";const r=WI(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function WI(e){return typeof e.constructor=="function"?e.constructor.name:null}function GI(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function KI(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Or(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=QI(e)),t}function Tp(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?xt(2):`Expected the root reducer to be a function. Instead, received: '${Or(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?xt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?xt(1):`Expected the enhancer to be a function. Instead, received: '${Or(r)}'`);return r(Tp)(e,t)}let n=e,s=t,i=new Map,o=i,a=0,c=!1;function u(){o===i&&(o=new Map,i.forEach((v,y)=>{o.set(y,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?xt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?xt(4):`Expected the listener to be a function. Instead, received: '${Or(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?xt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;u();const C=a++;return o.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?xt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,u(),o.delete(C),i=null}}}function m(v){if(!xp(v))throw new Error(process.env.NODE_ENV==="production"?xt(7):`Actions must be plain objects. Instead, the actual type was: '${Or(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?xt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?xt(17):`Action "type" property must be a string. Instead, the actual type was: '${Or(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?xt(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(i=o).forEach(C=>{C()}),v}function p(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?xt(10):`Expected the nextReducer to be a function. Instead, received: '${Or(v)}`);n=v,m({type:pn.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?xt(11):`Expected the observer to be an object. Instead, received: '${Or(y)}'`);function C(){const _=y;_.next&&_.next(d())}return C(),{unsubscribe:v(C)}},[ed](){return this}}}return m({type:pn.INIT}),{dispatch:m,subscribe:f,getState:d,replaceReducer:p,[ed]:b}}function td(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function YI(e,t,r,n){const s=Object.keys(t),i=r&&r.type===pn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!xp(e))return`The ${i} has unexpected type of "${Or(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const o=Object.keys(e).filter(a=>!t.hasOwnProperty(a)&&!n[a]);if(o.forEach(a=>{n[a]=!0}),!(r&&r.type===pn.REPLACE)&&o.length>0)return`Unexpected ${o.length>1?"keys":"key"} "${o.join('", "')}" found in ${i}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function ZI(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:pn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?xt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:pn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?xt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${pn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function rd(e){const t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const a=t[o];process.env.NODE_ENV!=="production"&&typeof e[a]>"u"&&td(`No reducer provided for key "${a}"`),typeof e[a]=="function"&&(r[a]=e[a])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let i;try{ZI(r)}catch(o){i=o}return function(a={},c){if(i)throw i;if(process.env.NODE_ENV!=="production"){const f=YI(a,r,c,s);f&&td(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const m=n[f],p=r[m],b=a[m],h=p(b,c);if(typeof h>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?xt(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[m]=h,u=u||h!==b}return u=u||n.length!==Object.keys(a).length,u?d:a}}function XI(e=rs().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const JI=rd({nodes:rd({focus:b1,edit:v1,open:C1,selection:S1,drag:XI}),dnd:_1}),eD=rs();function tD({treeProps:e,imperativeHandle:t,children:r}){const n=g.useRef(null),s=g.useRef(null),i=g.useRef(Tp(JI,rs(e))),o=r1.useSyncExternalStore(i.current.subscribe,i.current.getState,()=>eD),a=g.useMemo(()=>new Is(i.current,e,n,s),[]),c=g.useRef(0);return g.useMemo(()=>{c.current+=1,a.update(e)},Object.values(e)),g.useMemo(()=>{c.current+=1,a.update(a.props)},[o.nodes.open]),g.useImperativeHandle(t,()=>a),g.useEffect(()=>{a.props.selection?a.select(a.props.selection,{focus:!1}):a.deselectAll()},[a.props.selection]),g.useEffect(()=>{a.props.searchTerm||i.current.dispatch(Ya.clear(!0))},[a.props.searchTerm]),l.jsx(Rh.Provider,{value:a,children:l.jsx(Bh.Provider,{value:c.current,children:l.jsx(Fh.Provider,{value:o.nodes,children:l.jsx(Mh.Provider,{value:o.dnd,children:l.jsx(LA,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||OI,options:{rootElement:a.props.dndRootElement||void 0}},{children:r}))})})})})}function rD(){const e=Ft(),[,t]=hp(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:i,drop:o}=Sp({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});o&&e.dispatch(ns.hovering(o.parentId,o.index)),n.canDrop()?i&&e.showCursor(i):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function nD(e){return rD(),e.children}function sD(){const t=Ft().props.renderContainer||_p;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function iD(){const e=Ft(),{offset:t,mouse:r,item:n,isDragging:s}=nI(o=>({offset:o.getSourceClientOffset(),mouse:o.getClientOffset(),item:o.getItem(),isDragging:o.isDragging()})),i=e.props.renderDragPreview||Xh;return l.jsx(i,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function oD(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:i=>i[n],getChildren:typeof s=="function"?s:i=>i[s],childrenKey:typeof s=="string"?s:"children"}}class aD{constructor(t,r={}){this.accessors=oD(r),this.root=lD(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const s=this.find(t,n);if(s)return s}return null}return null}}function lD(e,t){const r=new Ep({},null,t,"ROOT");return r.children=e.map(n=>Vl(n,r,t)),r}function Vl(e,t,r){const n=new Ep(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(i=>Vl(i,n,r))),n}class Ep{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const i=Vl(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,i);const o=this.accessors.childrenKey,a=this.data;a[o]=(s=a[o])!==null&&s!==void 0?s:[],a[o].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let cD=0;function uD(e,t={}){const[r,n]=g.useState(e),s=t.idAccessor,i=t.childrenAccessor,o=g.useMemo(()=>new aD(r,{idAccessor:s,childrenAccessor:i}),[r,s,i]),a=b=>{for(const h of b.dragIds)o.move({id:h,parentId:b.parentId,index:b.index});n(o.data)},c=({name:b,id:h})=>{o.update({id:h,changes:{name:b}}),n(o.data)},u=typeof s=="string"?s:"id",d=typeof i=="string"?i:"children";return[r,{onMove:a,onRename:c,onCreate:({parentId:b,index:h,type:v})=>{if(typeof s=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof i=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[u]:`simple-tree-id-${cD++}`,name:""};return v==="internal"&&(y[d]=[]),o.create({parentId:b,index:h,data:y}),n(o.data),y},onDelete:b=>{b.ids.forEach(h=>o.drop({id:h})),n(o.data)}}]}function dD(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
- Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=uD(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function fD(e,t){const r=dD(e);return l.jsxs(tD,{treeProps:r,imperativeHandle:t,children:[l.jsx(nD,{children:l.jsx(sD,{})}),l.jsx(iD,{})]})}const hD=g.forwardRef(fD);function Hl(){return re(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function pD(){return re(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=i=>{var o;for(const a of i){if(a.id===e.selectedNodeId)return a;if((o=a.children)!=null&&o.length){const c=r(a.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const nd={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},sd={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},id=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource","Dynamic Course Assessment","Dynamic QuestionSet"],mD=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"},{label:"Dynamic Course Assessment",value:"Dynamic Course Assessment"},{label:"Dynamic QuestionSet",value:"Dynamic QuestionSet"}];function gD(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function oi(e){const t=gD(e);return{key:t,color:nd[t]??nd.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:sd[t]??sd.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const vD="_row_nm332_1",yD="_grip_nm332_16",bD="_menuBtn_nm332_19",CD="_rowLp_nm332_23",SD="_selected_nm332_27",_D="_title_nm332_32",wD="_dropTarget_nm332_41",xD="_toggle_nm332_58",TD="_ctIcon_nm332_73",ED="_ctIconLp_nm332_85",AD="_folderIcon_nm332_89",kD="_rootIcon_nm332_94",ID="_titleLp_nm332_110",DD="_levelTitle_nm332_114",LD="_renameInput_nm332_119",OD="_dropHere_nm332_128",ND="_menuWrap_nm332_138",jD="_menu_nm332_19",PD="_dangerItem_nm332_190",it={row:vD,grip:yD,menuBtn:bD,rowLp:CD,selected:SD,title:_D,dropTarget:wD,toggle:xD,ctIcon:TD,ctIconLp:ED,folderIcon:AD,rootIcon:kD,titleLp:ID,levelTitle:DD,renameInput:LD,dropHere:OD,menuWrap:ND,menu:jD,dangerItem:PD},RD={video:_o,pdf:Js,h5p:yo,scorm:Co,audio:bo,quiz:vo,course:Qr,default:Wr},FD=({node:e,style:t,dragHandle:r,editorMode:n})=>{const[s,i]=g.useState(!1),[o,a]=g.useState(!1),[c,u]=g.useState(e.data.name),d=g.useRef(null),f=oe(),m=K(N=>N.editorProfile),p=n==="edit",b=Hl(),h=oi(e.data),v=RD[h.key]??Wr,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),_=m.key==="learningPath",x=C?_?Nh:wy:S?_?Ny:Bf:v,E=_&&S&&!C&&!lt(e.data),D=e.level+1<=m.maxDepth,T=_?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,j=_?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;g.useEffect(()=>{if(!s)return;const N=R=>{var M;(M=d.current)!=null&&M.contains(R.target)||i(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[s]);const P=g.useCallback(()=>{c.trim()&&e.submit(c.trim()),a(!1)},[c,e]),O=g.useCallback(N=>{N.key==="Enter"&&P(),N.key==="Escape"&&(u(e.data.name),a(!1))},[P,e.data.name]);return l.jsxs("div",{className:[it.row,_?it.rowLp:"",y?it.selected:"",e.state.isOver&&S?it.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[p&&l.jsx("span",{ref:r,className:it.grip,"aria-hidden":"true",children:l.jsx(qf,{size:14})}),l.jsx("button",{className:it.toggle,onClick:N=>{N.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(xl,{size:14}):l.jsx(Cn,{size:14})}),l.jsx("span",{className:[it.ctIcon,C||S?it.folderIcon:h.bgClass,_?it.ctIconLp:"",C&&_?it.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(x,{size:C&&_?15:12})}),o?l.jsx("input",{className:it.renameInput,value:c,autoFocus:!0,onChange:N=>u(N.target.value),onBlur:P,onKeyDown:O,onClick:N=>N.stopPropagation()}):l.jsx("span",{className:[it.title,_?it.titleLp:"",E?it.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>p&&a(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:it.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),p&&l.jsxs("div",{className:it.menuWrap,ref:d,children:[l.jsx("button",{className:it.menuBtn,onClick:N=>{N.stopPropagation(),i(R=>!R)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Ff,{size:14})}),s&&l.jsxs("div",{className:it.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{a(!0),i(!1)},children:[l.jsx(Fy,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&D&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),i(!1)},children:[l.jsx(Mf,{size:13})," ",T]}),e.data.parent&&b&&!_&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),i(!1)},children:[l.jsx(Sn,{size:13})," ",j]}),!C&&l.jsxs("button",{role:"menuitem",className:it.dangerItem,onClick:()=>{e.tree.delete(e.id),i(!1)},children:[l.jsx(So,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function MD(e,t){var i,o;const n=((i=(await Fe.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:i.result)??{},s=((o=n.content)==null?void 0:o.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function BD(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function qD(e,t){var a;const r=await MD(e,t.name),n=await BD(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((a=(await Fe.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:a.result)??{}).processId??""}}async function $D(e){var r;return((r=(await Fe.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Ap(e){var n,s,i;const r=(i=(s=(n=(await Fe.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:i.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function UD(e){return Ap(e)}const zD="_container_jw2be_1",VD="_header_jw2be_13",HD="_title_jw2be_22",QD="_closeBtn_jw2be_29",WD="_body_jw2be_45",GD="_dropZone_jw2be_54",KD="_dragOver_jw2be_67",YD="_hasFile_jw2be_72",ZD="_hiddenInput_jw2be_78",XD="_fileInfo_jw2be_82",JD="_fileIcon_jw2be_89",eL="_fileName_jw2be_93",tL="_fileSize_jw2be_100",rL="_dropHint_jw2be_105",nL="_dropIcon_jw2be_112",sL="_dropText_jw2be_117",iL="_dropSubtext_jw2be_124",oL="_sampleLink_jw2be_130",aL="_statusBar_jw2be_145",lL="_status_uploading_jw2be_154",cL="_status_processing_jw2be_154",uL="_status_done_jw2be_159",dL="_status_error_jw2be_164",fL="_successDetail_jw2be_170",hL="_spinner_jw2be_175",pL="_spin_jw2be_175",mL="_errorMsg_jw2be_191",gL="_failedSection_jw2be_197",vL="_failedTitle_jw2be_203",yL="_tableWrap_jw2be_213",bL="_failedTable_jw2be_219",CL="_reasonCell_jw2be_244",SL="_footer_jw2be_248",Ue={container:zD,header:VD,title:HD,closeBtn:QD,body:WD,dropZone:GD,dragOver:KD,hasFile:YD,hiddenInput:ZD,fileInfo:XD,fileIcon:JD,fileName:eL,fileSize:tL,dropHint:rL,dropIcon:nL,dropText:sL,dropSubtext:iL,sampleLink:oL,statusBar:aL,status_uploading:lL,status_processing:cL,status_done:uL,status_error:dL,successDetail:fL,spinner:hL,spin:pL,errorMsg:mL,failedSection:gL,failedTitle:vL,tableWrap:yL,failedTable:bL,reasonCell:CL,footer:SL},_L=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=oe(),[i,o]=g.useState(null),[a,c]=g.useState(!1),[u,d]=g.useState("idle"),[f,m]=g.useState(""),[p,b]=g.useState([]),[h,v]=g.useState(null),y=g.useRef(null),C=g.useRef(null),S=g.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);g.useEffect(()=>()=>S(),[S]);const _=O=>O.name.toLowerCase().endsWith(".csv")?O.size>50*1024*1024?(m(s.csvUpload.fileTooLarge),!1):!0:(m(s.csvUpload.invalidFileType),!1),x=g.useCallback(O=>{m(""),b([]),v(null),d("idle"),_(O)&&o(O)},[]),E=g.useCallback(O=>{O.preventDefault(),c(!1);const N=O.dataTransfer.files[0];N&&x(N)},[x]),D=g.useCallback(O=>{var R;const N=(R=O.target.files)==null?void 0:R[0];N&&x(N),O.target.value=""},[x]),T=g.useCallback(async()=>{try{const O=await UD(e),N=document.createElement("a");N.href=O,N.download="sample_hierarchy.csv",N.target="_blank",N.click()}catch{m(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),j=g.useCallback(async()=>{if(i){d("uploading"),m(""),b([]);try{const{processId:O}=await qD(e,i);if(!O){d("done"),v(null),setTimeout(t,1500);return}d("processing"),C.current=setInterval(async()=>{try{const N=await $D(O);N.status==="COMPLETED"?(S(),d("done"),v(N.successCount??null),N.failedRecords&&N.failedRecords.length>0?b(N.failedRecords):setTimeout(t,1500)):N.status==="FAILED"&&(S(),d("error"),m(s.csvUpload.processingFailed),N.failedRecords&&b(N.failedRecords))}catch{S(),d("error"),m(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),m(s.csvUpload.uploadFailed)}}},[e,i,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),P={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Ue.container,children:[l.jsxs("div",{className:Ue.header,children:[l.jsx("h2",{className:Ue.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Ue.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(br,{size:18})})]}),l.jsxs("div",{className:Ue.body,children:[l.jsxs("div",{className:`${Ue.dropZone} ${a?Ue.dragOver:""} ${i?Ue.hasFile:""}`,onDragEnter:O=>{O.preventDefault(),c(!0)},onDragOver:O=>{O.preventDefault(),c(!0)},onDragLeave:O=>{O.preventDefault(),c(!1)},onDrop:E,onClick:()=>{var O;return(O=y.current)==null?void 0:O.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:O=>{var N;return O.key==="Enter"&&((N=y.current)==null?void 0:N.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ue.hiddenInput,onChange:D,"aria-hidden":"true"}),i?l.jsxs("div",{className:Ue.fileInfo,children:[l.jsx(Js,{size:24,className:Ue.fileIcon}),l.jsx("span",{className:Ue.fileName,children:i.name}),l.jsxs("span",{className:Ue.fileSize,children:["(",(i.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ue.dropHint,children:[l.jsx(Ma,{size:32,className:Ue.dropIcon}),l.jsx("p",{className:Ue.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Ue.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ue.sampleLink,onClick:T,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&l.jsxs("div",{className:`${Ue.statusBar} ${Ue[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&l.jsx("span",{className:Ue.spinner,"aria-hidden":"true"}),P[u],u==="done"&&h!==null&&l.jsx("span",{className:Ue.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(h))})]}),f&&l.jsx("p",{className:Ue.errorMsg,role:"alert",children:f}),p.length>0&&l.jsxs("div",{className:Ue.failedSection,children:[l.jsx("h4",{className:Ue.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(p.length))}),l.jsx("div",{className:Ue.tableWrap,children:l.jsxs("table",{className:Ue.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:s.csvUpload.rowHeader}),l.jsx("th",{children:s.csvUpload.nameHeader}),l.jsx("th",{children:s.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:p.map((O,N)=>l.jsxs("tr",{children:[l.jsx("td",{children:O.rowNumber??N+1}),l.jsx("td",{children:O.name??"—"}),l.jsx("td",{className:Ue.reasonCell,children:O.reason??s.csvUpload.unknownError})]},N))})]})})]})]}),l.jsxs("div",{className:Ue.footer,children:[l.jsx(Re,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),l.jsx(Re,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!i||u==="done",onClick:j,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function Ql(){var v,y,C,S,_,x,E;const e=oe(),t=re(D=>D.treeData),r=re(D=>D.treeCache),n=re(D=>D.deleteNode),s=yr(D=>D.activeAssessmentSlot),i=yr(D=>D.setActiveAssessmentSlot),o=yr(D=>D.openModal),a=((v=t[0])==null?void 0:v.children)??[],c=a[0],u=a.length>1?a[a.length-1]:void 0,d=lt(c),f=lt(u),m=t[0],p=m?((y=r[m.id])==null?void 0:y.policy)??((C=m.metadata)==null?void 0:C.policy):void 0,b=!!p&&kh.has(p),h=D=>{const T=D==="pre"?c:u;if(!T)return;const j=D==="pre"&&b?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;o("confirmDelete",{message:j,onConfirm:()=>n(T.id)})};return{pre:{level:c,filled:d,courseName:d?(_=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:_.name:void 0,required:b},post:{level:u,filled:f,courseName:f?(E=(x=u==null?void 0:u.children)==null?void 0:x[0])==null?void 0:E.name:void 0,required:!1},activeAssessmentSlot:s,setActiveAssessmentSlot:i,deleteSlot:h}}const wL="_container_2qylm_1",xL="_header_2qylm_8",TL="_sectionLabel_2qylm_18",EL="_headerActions_2qylm_26",AL="_iconBtn_2qylm_33",kL="_menuWrap_2qylm_51",IL="_dropdownMenu_2qylm_55",DL="_treeWrapper_2qylm_87",LL="_csvModal_2qylm_103",OL="_footer_2qylm_113",tr={container:wL,header:xL,sectionLabel:TL,headerActions:EL,iconBtn:AL,menuWrap:kL,dropdownMenu:IL,treeWrapper:DL,csvModal:LL,footer:OL},NL=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Te;const n=oe(),s=g.useRef(null),i=g.useRef(null),o=g.useRef(null),[a,c]=g.useState(400),[u,d]=g.useState(!1),[f,m]=g.useState(!1),[p,b]=g.useState("create"),{treeData:h,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,getNodeById:_,reorderChildren:x,moveNode:E,setTreeData:D}=re(),T=yr(Y=>Y.openModal),j=K(Y=>Y.editorProfile),P=j.key==="learningPath",O=e==="edit",N=Hl(),R=O&&N,M=P?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,$=j.maxDepth>1,ee=(((Te=h[0])==null?void 0:Te.children)??[]).some(Y=>Y.isFolder),{pre:H,post:te,deleteSlot:de}=Ql(),{level:fe}=H,{level:pe}=te,ae=K(Y=>{var ce,Q,Ce,qe;return((Q=(ce=Y.editorConfig)==null?void 0:ce.context)==null?void 0:Q.contentId)??((qe=(Ce=Y.editorConfig)==null?void 0:Ce.context)==null?void 0:qe.identifier)??""}),we=K(Y=>{var Q,Ce;const ce=(Ce=(Q=Y.categoryMeta)==null?void 0:Q.sourcingSettings)==null?void 0:Ce.collection;return(ce==null?void 0:ce.enableBulkUpload)!==!1}),ye=j.features.csvUpload&&we;g.useEffect(()=>{const Y=i.current;if(!Y)return;const ce=new ResizeObserver(()=>{c(Y.clientHeight||400)});return ce.observe(Y),c(Y.clientHeight||400),()=>ce.disconnect()},[]),g.useEffect(()=>{if(!u)return;const Y=ce=>{var Q;(Q=o.current)!=null&&Q.contains(ce.target)||d(!1)};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[u]);const F=g.useCallback(Y=>{Y.length>0&&y(Y[0].data.id)},[y]),B=g.useCallback(({parentId:Y,index:ce,dragIds:Q})=>{if(!Y)return;const Ce=Q[0],qe=il(h,Ce);if(!qe)return;const et=qe.parent;if(et===Y){const $e=il(h,Y);if(!($e!=null&&$e.children))return;const We=$e.children.findIndex(tt=>tt.id===Ce);if(We<0)return;x(Y,We,ce>We?ce-1:ce)}else E(Ce,et??"",Y)},[h,x,E]),Z=g.useCallback(({ids:Y})=>{if(!P){for(const Q of Y)S(Q);return}if(Y.length===1){const Q=Y[0];if((fe==null?void 0:fe.id)===Q){de("pre");return}if((pe==null?void 0:pe.id)===Q){de("post");return}const Ce=_(Q),qe=Ce!=null&&Ce.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",Ce.name):n.learningPath.deleteCourseConfirm;T("confirmDelete",{message:qe,onConfirm:()=>S(Q)});return}const ce=n.learningPath.deleteMultipleConfirm.replace("{count}",String(Y.length));T("confirmDelete",{message:ce,onConfirm:()=>{for(const Q of Y)S(Q)}})},[S,de,P,fe,pe,_,T,n]),he=g.useCallback(({parentId:Y})=>{var Ce;const ce=Y??((Ce=h[0])==null?void 0:Ce.id)??"";if(!ce)return{id:crypto.randomUUID()};const Q=C(ce,"unit");return Q?{id:Q}:(Se.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,h,n]),be=g.useCallback(()=>{var ce;const Y=(ce=h[0])==null?void 0:ce.id;Y&&(C(Y,"unit")||Se.error(n.outlineTree.maxDepthReachedToast))},[h,C,n]),me=g.useCallback(()=>{v&&(C(v,"subunit")||Se.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),le=g.useCallback(async()=>{if(d(!1),!!ae)try{const Y=await Ap(ae),ce=await fetch(Y).then(qe=>qe.blob()),Q=URL.createObjectURL(ce),Ce=document.createElement("a");Ce.href=Q,Ce.download=`${ae}-folders.csv`,Ce.style.display="none",document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),URL.revokeObjectURL(Q)}catch{Se.error(n.outlineTree.downloadCsvFailedToast)}},[ae,n]),ve=g.useCallback(async()=>{if(m(!1),!!ae)try{const{rootNode:Y}=await bh(ae);D([Y]),Se.success(n.outlineTree.outlineRefreshedToast)}catch{Se.error(n.outlineTree.outlineRefreshFailedToast)}},[ae,D,n]);return l.jsxs("div",{className:tr.container,children:[l.jsxs("div",{className:tr.header,children:[P&&l.jsx("span",{className:tr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:tr.headerActions,children:[O&&ye&&l.jsxs("div",{className:tr.menuWrap,ref:o,children:[l.jsx("button",{type:"button",className:tr.iconBtn,onClick:()=>d(Y=>!Y),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:l.jsx(Ff,{size:15})}),u&&l.jsxs("div",{className:tr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ee,title:ee?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),b("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:le,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ee,title:ee?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),b("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:tr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Py,{size:15}):l.jsx(jy,{size:15})})]})]}),l.jsx("div",{className:tr.treeWrapper,ref:i,children:l.jsx(hD,{ref:s,data:h,idAccessor:"id",childrenAccessor:"children",onSelect:F,onMove:O?B:void 0,onDelete:O?Z:void 0,onCreate:O?he:void 0,disableEdit:!O,disableDrop:!O,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:a,width:"100%",children:Y=>l.jsx(FD,{...Y,editorMode:e})})}),O&&l.jsxs("div",{className:tr.footer,children:[l.jsxs(Re,{variant:"ghost",size:"sm",onClick:be,disabled:!R,children:[l.jsx(Sn,{size:14})," ",M]}),$&&l.jsxs(Re,{variant:"ghost",size:"sm",onClick:me,disabled:!R||!v,children:[l.jsx(Mf,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:tr.csvModal,children:l.jsx(_L,{contentId:ae,mode:p,onComplete:ve,onClose:()=>m(!1)})})]})};function il(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=il(r.children,t);if(n)return n}}}const jL="_breadcrumb_zd1aj_1",PL="_crumb_zd1aj_10",RL="_sep_zd1aj_26",FL="_current_zd1aj_31",ys={breadcrumb:jL,crumb:PL,sep:RL,current:FL},ML=({crumbs:e})=>{const t=re(n=>n.selectNode),r=oe();return e.length?l.jsxs("nav",{className:ys.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:ys.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Ly,{size:13})}),e.map((n,s)=>l.jsxs(g.Fragment,{children:[l.jsx(xl,{size:13,className:ys.sep}),s<e.length-1?l.jsx("button",{className:ys.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:ys.current,children:n.name})]},n.id))]}):null},BL="_tabBar_qhks1_1",qL="_tab_qhks1_1",$L="_active_qhks1_29",UL="_error_qhks1_35",zL="_errorDot_qhks1_39",bs={tabBar:BL,tab:qL,active:$L,error:UL,errorDot:zL},VL=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=oe(),i=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],o=n?i.filter(a=>n.includes(a.id)):i;return l.jsx("div",{className:bs.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:o.map(a=>l.jsxs("button",{role:"tab","aria-selected":e===a.id,"aria-controls":`panel-${a.id}`,className:[bs.tab,e===a.id?bs.active:"",r.includes(a.id)?bs.error:""].join(" "),onClick:()=>t(a.id),children:[a.label,r.includes(a.id)&&l.jsx("span",{className:bs.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},a.id))})};var ai=e=>e.type==="checkbox",tn=e=>e instanceof Date,vt=e=>e==null;const kp=e=>typeof e=="object";var Ze=e=>!vt(e)&&!Array.isArray(e)&&kp(e)&&!tn(e),ol=e=>Ze(e)&&e.target?ai(e.target)?e.target.checked:e.target.value:e,Ip=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Dp=e=>{const t=e.constructor&&e.constructor.prototype;return Ze(t)&&t.hasOwnProperty("isPrototypeOf")},No=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Xe(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(No&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(Ze(e)&&Dp(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Xe(e[s]));return n}const jr={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},sr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},rr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ua="form",Lp="root",Op=["__proto__","constructor","prototype"];var li=e=>/^\w*$/.test(e),Qe=e=>e===void 0,jo=e=>e.split(/[.[\]'"]/g).filter(Boolean),G=(e,t,r)=>{if(!t||!Ze(e))return r;const n=li(t)?[t]:jo(t);if(n.some(i=>Op.includes(i)))return r;const s=n.reduce((i,o)=>vt(i)?void 0:i[o],e);return Qe(s)||s===e?Qe(e[t])?r:e[t]:s},Ut=e=>typeof e=="boolean",Et=e=>typeof e=="function",Ve=(e,t,r)=>{let n=-1;const s=li(t)?[t]:jo(t),i=s.length,o=i-1;for(;++n<i;){const a=s[n];let c=r;if(n!==o){const u=e[a];c=Ze(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Op.includes(a))return;e[a]=c,e=e[a]}};const Wl=g.createContext(null);Wl.displayName="HookFormControlContext";const Gl=()=>g.useContext(Wl);var Np=(e,t,r,n=!0)=>{const s={};for(const i in e)Object.defineProperty(s,i,{get:()=>{const o=i;return t._proxyFormState[o]!==sr.all&&(t._proxyFormState[o]=!n||sr.all),r&&(r[o]=!0),e[o]}});return s};const Kl=No?g.useLayoutEffect:g.useEffect;function HL(e){const t=Gl(),{control:r=t,disabled:n,name:s,exact:i}=e||{},[o,a]=g.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=g.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Kl(()=>r._subscribe({name:s,formState:c.current,exact:i,callback:u=>{!n&&a({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),g.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),g.useMemo(()=>Np(o,r,c.current,!1),[o,r])}var At=e=>typeof e=="string",al=(e,t,r,n,s)=>At(e)?(n&&t.watch.add(e),G(r,e,s)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),G(r,i))):(n&&(t.watchAll=!0),r),ll=e=>vt(e)||!kp(e);const od=(e,t)=>t.length===0&&!Array.isArray(e)&&!Dp(e);function zt(e,t,r=new WeakMap){if(e===t)return!0;if(ll(e)||ll(t))return Object.is(e,t);if(tn(e)&&tn(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(od(e,n)||od(t,s))return Object.is(e,t);const i=r.get(e);if(i&&i.has(t))return!0;i?i.add(t):r.set(e,new WeakSet([t]));for(const o of n){const a=e[o];if(!(o in t))return!1;if(o!=="ref"){const c=t[o];if(tn(a)&&tn(c)||(Ze(a)||Array.isArray(a))&&(Ze(c)||Array.isArray(c))?!zt(a,c,r):!Object.is(a,c))return!1}}return!0}function QL(e){const t=Gl(),{control:r=t,name:n,defaultValue:s,disabled:i,exact:o,compute:a}=e||{},c=g.useRef(s),u=g.useRef(a),d=g.useRef(void 0),f=g.useRef(r),m=g.useRef(n);u.current=a;const[p,b]=g.useState(()=>{const _=r._getWatch(n,c.current);return u.current?u.current(_):_}),h=g.useCallback(_=>{const x=al(n,r._names,_||r._formValues,!1,c.current);return u.current?u.current(x):x},[r._formValues,r._names,n]),v=g.useCallback(_=>{if(!i){const x=al(n,r._names,_||r._formValues,!1,c.current);if(u.current){const E=u.current(x);zt(E,d.current)||(b(E),d.current=E)}else b(x)}},[r._formValues,r._names,i,n]);Kl(()=>((f.current!==r||!zt(m.current,n))&&(f.current=r,m.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:_=>{v(_.values)}})),[r,o,n,v]),g.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=m.current,S=g.useMemo(()=>{if(i)return null;const _=!y&&!zt(C,n);return y||_?h():null},[i,y,n,C,h]);return S!==null?S:p}function ci(e){const t=Gl(),{name:r,disabled:n,control:s=t,shouldUnregister:i,defaultValue:o,exact:a=!0}=e,c=Ip(s._names.array,r),u=g.useMemo(()=>G(s._formValues,r,G(s._defaultValues,r,o)),[s,r,o]),d=QL({control:s,name:r,defaultValue:u,exact:a}),f=HL({control:s,name:r,exact:a}),m=g.useRef(e),p=g.useRef(null),b=g.useRef(s.register(r,{...e.rules,value:d,...Ut(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const h=g.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!G(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!G(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!G(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!G(f.validatingFields,r)},error:{enumerable:!0,get:()=>G(f.errors,r)}}),[f,r]),v=g.useCallback(_=>{const x=ol(_);return G(s._fields,r)||(b.current=s.register(r,{...m.current.rules,value:x})),b.current.onChange({target:{value:ol(_),name:r},type:jr.CHANGE})},[r,s]),y=g.useCallback(()=>b.current.onBlur({target:{value:G(s._formValues,r),name:r},type:jr.BLUR}),[r,s._formValues]),C=g.useCallback(_=>{_&&(p.current={focus:()=>Et(_.focus)&&_.focus(),select:()=>Et(_.select)&&_.select(),setCustomValidity:E=>Et(_.setCustomValidity)&&_.setCustomValidity(E),reportValidity:()=>Et(_.reportValidity)&&_.reportValidity()});const x=G(s._fields,r);x&&x._f&&_&&(x._f.ref=p.current)},[s._fields,r]),S=g.useMemo(()=>({name:r,value:d,...Ut(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,d]);return g.useEffect(()=>{const _=s._options.shouldUnregister||i;s.register(r,{...m.current.rules,...Ut(m.current.disabled)?{disabled:m.current.disabled}:{}});const x=(E,D)=>{const T=G(s._fields,E);T&&T._f&&(T._f.mount=D)};if(x(r,!0),_){const E=Xe(G(i?s._defaultValues:s._options.values||s._defaultValues,r,G(s._options.defaultValues,r,m.current.defaultValue)));Ve(s._defaultValues,r,E),Qe(G(s._formValues,r))&&Ve(s._formValues,r,E)}if(!c&&s.register(r),p.current){const E=G(s._fields,r);E&&E._f&&(E._f.ref=p.current)}return()=>{(c?_&&!s._state.action:_)?s.unregister(r):x(r,!1)}},[r,s,c,i]),g.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),g.useMemo(()=>({field:S,formState:f,fieldState:h}),[S,f,h])}const WL=e=>e.render(ci(e)),Yl=g.createContext(null);Yl.displayName="HookFormContext";const Jt=()=>g.useContext(Yl),GL=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:m,unregister:p,control:b,register:h,setFocus:v,subscribe:y})=>{const C=g.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:i,setValue:o,setValues:a,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:m,unregister:p,control:b,register:h,setFocus:v,subscribe:y}),[i,b,u,n,r,m,h,f,d,s,v,o,a,y,c,p,t]);return g.createElement(Yl.Provider,{value:C},g.createElement(Wl.Provider,{value:C.control},e))};var KL=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},jp=e=>Array.isArray(e)?e.filter(Boolean):[],$i=e=>Array.isArray(e)?e:[e],ad=()=>{let e=[];return{get observers(){return e},next:s=>{for(const i of e)i.next&&i.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(i=>i!==s)}}),unsubscribe:()=>{e=[]}}};function Pp(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],i=t[n];if(s&&Ze(s)&&i){const o=Pp(s,i);Ze(o)&&(r[n]=o)}else e[n]&&(r[n]=i)}return r}var ft=e=>Ze(e)&&!Object.keys(e).length,Zl=e=>e.type==="file",ro=e=>{if(!No)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Rp=e=>e.type==="select-multiple",Xl=e=>e.type==="radio",YL=e=>Xl(e)||ai(e),da=e=>ro(e)&&e.isConnected;function ZL(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(vt(e)){e=void 0;break}e=e[t[n]],n++}return e}function XL(e){for(const t in e)if(e.hasOwnProperty(t)&&!Qe(e[t]))return!1;return!0}function nt(e,t){if(At(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:li(t)?[t]:jo(t),n=r.length===1?e:ZL(e,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(Ze(n)&&ft(n)||Array.isArray(n)&&XL(n))&&nt(e,r.slice(0,-1)),e}var JL=e=>{for(const t in e)if(Et(e[t]))return!0;return!1};function Fp(e){return Array.isArray(e)||Ze(e)&&!JL(e)}function cl(e,t={}){for(const r in e){const n=e[r];Fp(n)?(t[r]=Array.isArray(n)?[]:{},cl(n,t[r])):Qe(n)||(t[r]=!0)}return t}function ul(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>ul(r));return t.some(r=>r!==void 0)?t:void 0}if(Ze(e)){const t={};for(const r in e){const n=ul(e[r]);Qe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function Xr(e,t,r){r||(r=cl(t));for(const n in e){const s=e[n];if(Fp(s))Qe(t)||ll(r[n])?r[n]=cl(s,Array.isArray(s)?[]:{}):Xr(s,vt(t)?{}:t[n],r[n]);else{const i=t[n];r[n]=!zt(s,i)}}return ul(r)||{}}const ld={value:!1,isValid:!1},cd={value:!0,isValid:!0};var Mp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?cd:{value:e[0].value,isValid:!0}:cd:ld}return ld},Bp=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Qe(e)?e:t?e===""?NaN:e&&+e:r&&At(e)?new Date(e):n?n(e):e;const ud={isValid:!1,value:null};var qp=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,ud):ud;function dd(e){const t=e.ref;return Zl(t)?t.files:Xl(t)?qp(e.refs).value:Rp(t)?[...t.selectedOptions].map(({value:r})=>r):ai(t)?Mp(e.refs).value:Bp(Qe(t.value)?e.ref.value:t.value,e)}var eO=(e,t,r,n)=>{const s={};for(const i of e){const o=G(t,i);o&&Ve(s,i,o._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},no=e=>e instanceof RegExp,Cs=e=>Qe(e)?e:no(e)?e.source:Ze(e)?no(e.value)?e.value.source:e.value:e,fd=e=>({isOnSubmit:!e||e===sr.onSubmit,isOnBlur:e===sr.onBlur,isOnChange:e===sr.onChange,isOnAll:e===sr.all,isOnTouch:e===sr.onTouched});const hd="AsyncFunction";var tO=e=>!!e&&!!e.validate&&!!(Et(e.validate)&&e.validate.constructor.name===hd||Ze(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===hd)),rO=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),fa=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Ds=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const i=G(e,s);if(i){const{_f:o,...a}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],s)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Ds(a,t))break}else if(Ze(a)&&Ds(a,t))break}}};function pd(e,t,r){const n=G(e,r);if(n||li(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),o=G(t,i),a=G(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(a&&a.type)return{name:i,error:a};if(a&&a.root&&a.root.type)return{name:`${i}.root`,error:a.root};s.pop()}return{name:r}}var nO=(e,t,r,n)=>{r(e);const{name:s,...i}=e;return ft(i)||n&&Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===(!n||sr.all))},sO=(e,t,r)=>!e||!t||e===t||$i(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),iO=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,oO=(e,t)=>!jp(G(e,t)).length&&nt(e,t),md=(e,t,r)=>{const n=G(e,r),s=Array.isArray(n)?n:[];return Ve(s,Lp,t[r]),Ve(e,r,s),e};function gd(e,t,r="validate"){if(At(e)||Array.isArray(e)&&e.every(At)||Ut(e)&&!e)return{type:r,message:At(e)?e:"",ref:t}}var On=e=>Ze(e)&&!no(e)?e:{value:e,message:""},vd=async(e,t,r,n,s,i)=>{const{ref:o,refs:a,required:c,maxLength:u,minLength:d,min:f,max:m,pattern:p,validate:b,name:h,valueAsNumber:v,mount:y}=e._f,C=G(r,h);if(!y||t.has(h))return{};const S=a?a[0]:o,_=N=>{if(s&&S.reportValidity){const R=Ut(N)?"":N||"";a?a.forEach(M=>M.setCustomValidity(R)):S.setCustomValidity(R),S.reportValidity()}},x={},E=Xl(o),D=ai(o),T=E||D,j=(v||Zl(o))&&Qe(o.value)&&Qe(C)||ro(o)&&o.value===""||C===""||Array.isArray(C)&&!C.length,P=KL.bind(null,h,n,x),O=(N,R,M,$=rr.maxLength,ee=rr.minLength)=>{const H=N?R:M;x[h]={type:N?$:ee,message:H,ref:o,...P(N?$:ee,H)}};if(i?!Array.isArray(C)||!C.length:c&&(!T&&(j||vt(C))||Ut(C)&&!C||D&&!Mp(a).isValid||E&&!qp(a).isValid)){const{value:N,message:R}=At(c)?{value:!!c,message:c}:On(c);if(N&&(x[h]={type:rr.required,message:R,ref:S,...P(rr.required,R)},!n))return _(R),x}if(!j&&(!vt(f)||!vt(m))){let N,R;const M=On(m),$=On(f);if(!vt(C)&&!isNaN(C)){const ee=o.valueAsNumber||C&&+C;vt(M.value)||(N=ee>M.value),vt($.value)||(R=ee<$.value)}else{const ee=o.valueAsDate||new Date(C),H=fe=>new Date(new Date().toDateString()+" "+fe),te=o.type=="time",de=o.type=="week";At(M.value)&&C&&(N=te?H(C)>H(M.value):de?C>M.value:ee>new Date(M.value)),At($.value)&&C&&(R=te?H(C)<H($.value):de?C<$.value:ee<new Date($.value))}if((N||R)&&(O(!!N,M.message,$.message,rr.max,rr.min),!n))return _(x[h].message),x}if((u||d)&&!j&&(At(C)||i&&Array.isArray(C))){const N=On(u),R=On(d),M=!vt(N.value)&&C.length>+N.value,$=!vt(R.value)&&C.length<+R.value;if((M||$)&&(O(M,N.message,R.message),!n))return _(x[h].message),x}if(p&&!j&&At(C)){const{value:N,message:R}=On(p);if(no(N)&&!C.match(N)&&(x[h]={type:rr.pattern,message:R,ref:o,...P(rr.pattern,R)},!n))return _(R),x}if(b){if(Et(b)){const N=await b(C,r),R=gd(N,S);if(R&&(x[h]={...R,...P(rr.validate,R.message)},!n))return _(R.message),x}else if(Ze(b)){let N={};for(const R in b){if(!ft(N)&&!n)break;const M=gd(await b[R](C,r),S,R);M&&(N={...M,...P(R,M.message)},_(M.message),n&&(x[h]=N))}if(!ft(N)&&(x[h]={ref:S,...N},!n))return x}}return _(!0),x};const aO={mode:sr.onSubmit,reValidateMode:sr.onChange,shouldFocusError:!0},$p={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function lO(e={}){let t={...aO,...e},r={...Xe($p),isLoading:Et(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=Ze(t.defaultValues)||Ze(t.values)?Xe(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Xe(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let m={...f};const p={array:ad(),state:ad()},b=t.criteriaMode===sr.all,h=w=>A=>{clearTimeout(u),u=setTimeout(w,A)},v=async w=>{if(!o.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||w)){let A;t.resolver?(A=ft((await P()).errors),y()):A=await R({fields:n,onlyCheckValid:!0,eventType:jr.VALID}),A!==r.isValid&&p.state.next({isValid:A})}},y=(w,A)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((w||Array.from(a.mount)).forEach(I=>{I&&(A?Ve(r.validatingFields,I,A):nt(r.validatingFields,I))}),p.state.next({validatingFields:r.validatingFields,isValidating:!ft(r.validatingFields)}))},C=()=>{r.dirtyFields=Xr(s,i)},S=(w,A=[],I,U,z=!0,W=!0)=>{if(U&&I&&!t.disabled){if(o.action=!0,W&&Array.isArray(G(n,w))){const V=I(G(n,w),U.argA,U.argB);z&&Ve(n,w,V)}if(W&&Array.isArray(G(r.errors,w))){const V=I(G(r.errors,w),U.argA,U.argB);z&&Ve(r.errors,w,V),oO(r.errors,w)}if((f.touchedFields||m.touchedFields)&&W&&Array.isArray(G(r.touchedFields,w))){const V=I(G(r.touchedFields,w),U.argA,U.argB);z&&Ve(r.touchedFields,w,V)}(f.dirtyFields||m.dirtyFields)&&C(),p.state.next({name:w,isDirty:$(w,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ve(i,w,A)},_=(w,A)=>{Ve(r.errors,w,A),r.errors={...r.errors},p.state.next({errors:r.errors})},x=w=>{r.errors=w,p.state.next({errors:r.errors,isValid:!1})},E=w=>{const A=li(w)?[w]:jo(w);let I=i,U=s;for(let z=0;z<A.length-1;z++){const W=A[z];if(I=vt(I)?I:I[W],U=vt(U)?U:U[W],I===null&&U!==null)return!0}return!1},D=(w,A,I,U)=>{const z=G(n,w);if(z){if(E(w))return;const W=Qe(G(i,w)),V=G(i,w,Qe(I)?G(s,w):I);Qe(V)||U&&U.defaultChecked||A?Ve(i,w,A?V:dd(z._f)):te(w,V),o.mount&&!o.action&&(v(),W&&r.isDirty&&(f.isDirty||m.isDirty)&&($()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&W&&!Qe(G(i,w))&&fa(w,a)&&(o.watch=!0))}},T=(w,A,I,U,z)=>{let W=!1,V=!1;const ne={name:w};if(!t.disabled){if(!I||U){(f.isDirty||m.isDirty)&&(V=r.isDirty,r.isDirty=ne.isDirty=$(),W=V!==ne.isDirty);const se=zt(G(s,w),A);V=!!G(r.dirtyFields,w),se!==r.isDirty?r.dirtyFields=Xr(s,i):se?nt(r.dirtyFields,w):Ve(r.dirtyFields,w,!0),ne.dirtyFields=r.dirtyFields,W=W||(f.dirtyFields||m.dirtyFields)&&V!==!se}if(I){const se=G(r.touchedFields,w);se||(Ve(r.touchedFields,w,I),ne.touchedFields=r.touchedFields,W=W||(f.touchedFields||m.touchedFields)&&se!==I)}W&&z&&p.state.next(ne)}return W?ne:{}},j=(w,A,I,U)=>{const z=G(r.errors,w),W=(f.isValid||m.isValid)&&Ut(A)&&r.isValid!==A;if(t.delayError&&I?(c=h(()=>_(w,I)),c(t.delayError)):(clearTimeout(u),c=null,I?Ve(r.errors,w,I):nt(r.errors,w),r.errors={...r.errors}),(I?!zt(z,I):z)||!ft(U)||W){const V={...U,...W&&Ut(A)?{isValid:A}:{},errors:r.errors,name:w};r={...r,...V},p.state.next(V)}},P=async w=>(y(w,!0),await t.resolver(i,t.context,eO(w||a.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),O=async w=>{const{errors:A}=await P(w);if(y(w),w){for(const I of w){const U=G(A,I);U?a.array.has(I)&&Ze(U)&&!Object.keys(U).some(z=>!Number.isNaN(Number(z)))?md(r.errors,{[I]:U},I):Ve(r.errors,I,U):nt(r.errors,I)}r.errors={...r.errors}}else r.errors=A;return A},N=async({name:w,eventType:A})=>{if(e.validate){const I=await e.validate({formValues:i,formState:r,name:w,eventType:A});if(Ze(I))for(const U in I){const z=I[U];z&&be(`${ua}.${U}`,{message:At(z.message)?z.message:"",type:z.type||rr.validate})}else At(I)||!I?be(ua,{message:I||"",type:rr.validate}):he(ua);return I}return!0},R=async({fields:w,onlyCheckValid:A,name:I,eventType:U,context:z={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(z.runRootValidation=!0,!await N({name:I,eventType:U})&&(z.valid=!1,A)))return z.valid;for(const W in w){const V=w[W];if(V){const{_f:ne,...se}=V;if(ne){const je=a.array.has(ne.name),Ge=V._f&&tO(V._f),st=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;Ge&&st&&y([ne.name],!0);const Vt=await vd(V,a.disabled,i,b,t.shouldUseNativeValidation&&!A,je);if(Ge&&st&&y([ne.name]),Vt[ne.name]&&(z.valid=!1,A)||(!A&&(G(Vt,ne.name)?je?md(r.errors,Vt,ne.name):Ve(r.errors,ne.name,Vt[ne.name]):nt(r.errors,ne.name)),e.shouldUseNativeValidation&&Vt[ne.name]))break}!ft(se)&&await R({context:z,onlyCheckValid:A,fields:se,name:W,eventType:U})}}return z.valid},M=()=>{for(const w of a.unMount){const A=G(n,w);A&&(A._f.refs?A._f.refs.every(I=>!da(I)):!da(A._f.ref))&&Te(w)}a.unMount=new Set},$=(w,A)=>!t.disabled&&(w&&A&&Ve(i,w,A),!zt(B(),s)),ee=(w,A,I)=>al(w,a,{...o.mount?i:Qe(A)?s:At(w)?{[w]:A}:A},I,A),H=w=>jp(G(o.mount?i:s,w,t.shouldUnregister?G(s,w,[]):[])),te=(w,A,I={},U=!1)=>{const z=G(n,w);let W=A;if(z){const V=z._f;V&&(!V.disabled&&Ve(i,w,Bp(A,V)),W=ro(V.ref)&&vt(A)?"":A,Rp(V.ref)?[...V.ref.options].forEach(ne=>ne.selected=W.includes(ne.value)):V.refs?ai(V.ref)?V.refs.forEach(ne=>{(!ne.defaultChecked||!ne.disabled)&&(Array.isArray(W)?ne.checked=!!W.find(se=>se===ne.value):ne.checked=W===ne.value||!!W)}):V.refs.forEach(ne=>ne.checked=ne.value===W):Zl(V.ref)?V.ref.value="":(V.ref.value=W,V.ref.type||p.state.next({name:w,values:U?i:Xe(i)})))}(I.shouldDirty||I.shouldTouch)&&T(w,W,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&F(w)},de=(w,A,I,U=!1)=>{for(const z in A){if(!A.hasOwnProperty(z))return;const W=A[z],V=w+"."+z,ne=G(n,V);(a.array.has(w)||Ze(W)||ne&&!ne._f)&&!tn(W)?de(V,W,I,U):te(V,W,I,U)}},fe=(w,A,I,U)=>{const z=G(n,w),W=a.array.has(w),V=U?A:Xe(A),ne=G(i,w),se=zt(ne,V);if(se||Ve(i,w,V),W)p.array.next({name:w,values:U?i:Xe(i)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&I.shouldDirty&&(C(),p.state.next({name:w,dirtyFields:r.dirtyFields,isDirty:$(w,V)}));else{const je=Array.isArray(V)&&!V.length||ft(V);!z||z._f||vt(V)||je?te(w,V,I,U):de(w,V,I,U)}if(!se){const je=fa(w,a),Ge=U?i:Xe(i);p.state.next({...je&&r,name:o.mount||je?w:void 0,values:Ge})}},pe=(w,A,I={})=>fe(w,A,I,!1),ae=(w,A={})=>{const I=Et(w)?w(i):w;if(!zt(i,I)){i={...i,...I};for(const U of a.mount)fe(U,G(I,U),A,!0);p.state.next({...r,name:void 0,type:void 0,values:i}),A.shouldValidate&&v()}},we=async w=>{o.mount=!0;const A=w.target;let I=A.name,U=!0;const z=G(n,I),W=se=>{U=Number.isNaN(se)||tn(se)&&isNaN(se.getTime())||zt(se,G(i,I,se))},V=fd(t.mode),ne=fd(t.reValidateMode);if(z){let se,je;const Ge=A.type?dd(z._f):ol(w),st=w.type===jr.BLUR||w.type===jr.FOCUS_OUT,Vt=!rO(z._f)&&!e.validate&&!t.resolver&&!G(r.errors,I)&&!z._f.deps||iO(st,G(r.touchedFields,I),r.isSubmitted,ne,V),us=fa(I,a,st);Ve(i,I,Ge),st?(!A||!A.readOnly)&&(z._f.onBlur&&z._f.onBlur(w),c&&c(0)):z._f.onChange&&z._f.onChange(w);const Yr=T(I,Ge,st),ct=!ft(Yr)||us;if(!st&&p.state.next({name:I,type:w.type,values:Xe(i)}),Vt)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?st&&v():st||v()),ct&&p.state.next({name:I,...us?{}:Yr});if(!t.resolver&&e.validate&&await N({name:I,eventType:w.type}),!st&&us&&p.state.next({...r}),t.resolver){const{errors:Ct}=await P([I]);if(y([I]),W(Ge),!U){!ft(Yr)&&p.state.next(Yr);return}const It=pd(r.errors,n,I),er=pd(Ct,n,It.name||I);se=er.error,I=er.name,je=ft(Ct)}else y([I],!0),se=(await vd(z,a.disabled,i,b,t.shouldUseNativeValidation))[I],y([I]),W(Ge),U&&(se?je=!1:(f.isValid||m.isValid)&&(je=await R({fields:n,onlyCheckValid:!0,name:I,eventType:w.type})));U&&(z._f.deps&&(!Array.isArray(z._f.deps)||z._f.deps.length>0)&&F(z._f.deps),j(I,je,se,Yr))}},ye=(w,A)=>{if(G(r.errors,A)&&w.focus)return w.focus(),1},F=async(w,A={})=>{let I,U;const z=$i(w);if(t.resolver){const W=await O(Qe(w)?w:z);I=ft(W),U=w?!z.some(V=>G(W,V)):I}else w?(U=(await Promise.all(z.map(async W=>{const V=G(n,W);return await R({fields:V&&V._f?{[W]:V}:V,eventType:jr.TRIGGER})}))).every(Boolean),!(!U&&!r.isValid)&&v()):U=I=await R({fields:n,name:w,eventType:jr.TRIGGER});return p.state.next({...!At(w)||(f.isValid||m.isValid)&&I!==r.isValid?{}:{name:w},...t.resolver||!w?{isValid:I}:{},errors:r.errors}),A.shouldFocus&&!U&&Ds(n,ye,w?z:a.mount),U},B=(w,A)=>{let I={...o.mount?i:s};return A&&(I=Pp(A.dirtyFields?r.dirtyFields:r.touchedFields,I)),Qe(w)?I:At(w)?G(I,w):w.map(U=>G(I,U))},Z=(w,A)=>({invalid:!!G((A||r).errors,w),isDirty:!!G((A||r).dirtyFields,w),error:G((A||r).errors,w),isValidating:!!G(r.validatingFields,w),isTouched:!!G((A||r).touchedFields,w)}),he=w=>{const A=w?$i(w):void 0;A==null||A.forEach(I=>nt(r.errors,I)),A?A.forEach(I=>{p.state.next({name:I,errors:r.errors})}):p.state.next({errors:{}})},be=(w,A,I)=>{const U=(G(n,w,{_f:{}})._f||{}).ref,z=G(r.errors,w)||{},{ref:W,message:V,type:ne,...se}=z;Ve(r.errors,w,{...se,...A,ref:U}),p.state.next({name:w,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&U&&U.focus&&U.focus()},me=(w,A)=>Et(w)?p.state.subscribe({next:I=>"values"in I&&w(I.values||ee(void 0,A),I)}):ee(w,A,!0),le=w=>p.state.subscribe({next:A=>{if(sO(w.name,A.name,w.exact)&&nO(A,w.formState||f,Gr,w.reRenderRoot)){const I={...i};w.callback({values:I,...r,...A,defaultValues:s})}}}).unsubscribe,ve=w=>(o.mount=!0,m={...m,...w.formState},le({...w,formState:{...d,...w.formState}})),Te=(w,A={})=>{for(const I of w?$i(w):a.mount)a.mount.delete(I),a.array.delete(I),A.keepValue||(nt(n,I),nt(i,I)),!A.keepError&&nt(r.errors,I),!A.keepDirty&&nt(r.dirtyFields,I),!A.keepTouched&&nt(r.touchedFields,I),!A.keepIsValidating&&nt(r.validatingFields,I),!t.shouldUnregister&&!A.keepDefaultValue&&nt(s,I);p.state.next({values:Xe(i)}),p.state.next({...r,...A.keepDirty?{isDirty:$()}:{}}),!A.keepIsValid&&v()},Y=({disabled:w,name:A})=>{if(Ut(w)&&o.mount||w||a.disabled.has(A)){const z=a.disabled.has(A)!==!!w;w?a.disabled.add(A):a.disabled.delete(A),z&&o.mount&&!o.action&&v()}},ce=(w,A={})=>{let I=G(n,w);const U=Ut(A.disabled)||Ut(t.disabled),z=!a.registerName.has(w)&&I&&I._f&&!I._f.mount;return Ve(n,w,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:w}},name:w,mount:!0,...A}}),a.mount.add(w),I&&!z?Y({disabled:Ut(A.disabled)?A.disabled:t.disabled,name:w}):D(w,!0,A.value),{...U?{disabled:A.disabled||t.disabled}:{},...t.progressive?{required:!!A.required,min:Cs(A.min),max:Cs(A.max),minLength:Cs(A.minLength),maxLength:Cs(A.maxLength),pattern:Cs(A.pattern)}:{},name:w,onChange:we,onBlur:we,ref:W=>{if(W){a.registerName.add(w),ce(w,A),a.registerName.delete(w),I=G(n,w);const V=Qe(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,ne=YL(V),se=I._f.refs||[];if(ne?se.find(je=>je===V):V===I._f.ref)return;Ve(n,w,{_f:{...I._f,...ne?{refs:[...se.filter(da),V,...Array.isArray(G(s,w))?[{}]:[]],ref:{type:V.type,name:w}}:{ref:V}}}),D(w,!1,void 0,V)}else I=G(n,w,{}),I._f&&(I._f.mount=!1),(t.shouldUnregister||A.shouldUnregister)&&!(Ip(a.array,w)&&o.action)&&a.unMount.add(w)}}},Q=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Ds(n,ye,a.mount),Ce=w=>{Ut(w)&&(p.state.next({disabled:w}),Ds(n,(A,I)=>{const U=G(n,I);U&&(A.disabled=U._f.disabled||w,Array.isArray(U._f.refs)&&U._f.refs.forEach(z=>{z.disabled=U._f.disabled||w}))},0,!1))},qe=(w,A)=>async I=>{let U;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let z=Xe(i);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:W,values:V}=await P();y(),r.errors=W,z=Xe(V)}else await R({fields:n,eventType:jr.SUBMIT});if(a.disabled.size)for(const W of a.disabled)nt(z,W);if(nt(r.errors,Lp),ft(r.errors)){p.state.next({errors:{}});try{await w(z,I)}catch(W){U=W}}else A&&await A({...r.errors},I),Q(),setTimeout(Q);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ft(r.errors)&&!U,submitCount:r.submitCount+1,errors:r.errors}),U)throw U},et=(w,A={})=>{G(n,w)&&(Qe(A.defaultValue)?pe(w,Xe(G(s,w))):(pe(w,A.defaultValue),Ve(s,w,Xe(A.defaultValue))),A.keepTouched||nt(r.touchedFields,w),A.keepDirty||(nt(r.dirtyFields,w),r.isDirty=A.defaultValue?$(w,Xe(G(s,w))):$()),A.keepError||(nt(r.errors,w),f.isValid&&v()),p.state.next({...r}))},$e=(w,A={})=>{const I=w?Xe(w):s,U=Xe(I),z=ft(w),W=U;if(A.keepDefaultValues||(s=I),!A.keepValues){if(A.keepDirtyValues){const V=new Set([...a.mount,...Object.keys(Xr(s,i))]);for(const ne of Array.from(V)){const se=G(r.dirtyFields,ne),je=G(i,ne),Ge=G(W,ne);se&&!Qe(je)?Ve(W,ne,je):!se&&!Qe(Ge)&&pe(ne,Ge)}}else{if(No&&Qe(w))for(const V of a.mount){const ne=G(n,V);if(ne&&ne._f){const se=Array.isArray(ne._f.refs)?ne._f.refs[0]:ne._f.ref;if(ro(se)){const je=se.closest("form");if(je){je.reset();break}}}}if(A.keepFieldsRef)for(const V of a.mount)pe(V,G(W,V));else n={}}if(t.shouldUnregister){if(i=A.keepDefaultValues?Xe(s):{},A.keepFieldsRef)for(const V of a.mount)Ve(i,V,G(W,V))}else i=Xe(W);p.array.next({values:{...W}}),p.state.next({values:{...W}})}a={mount:A.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!t.shouldUnregister&&!ft(W),o.watch=!!t.shouldUnregister,o.keepIsValid=!!A.keepIsValid,o.action=!1,A.keepErrors||(r.errors={}),p.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:z?!1:A.keepDirty?r.isDirty:A.keepValues?$():!!(A.keepDefaultValues&&!zt(w,s)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:z?{}:A.keepDirtyValues?A.keepDefaultValues&&i?Xr(s,i):r.dirtyFields:A.keepDefaultValues&&w?Xr(s,w):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},We=(w,A)=>$e(Et(w)?w(i):w,{...t.resetOptions,...A}),tt=(w,A={})=>{const I=G(n,w),U=I&&I._f;if(U){const z=U.refs?U.refs[0]:U.ref;z.focus&&setTimeout(()=>{z.focus(),A.shouldSelect&&Et(z.select)&&z.select()})}},Gr=w=>{r={...r,...w}},Kr={control:{register:ce,unregister:Te,getFieldState:Z,handleSubmit:qe,setError:be,_subscribe:le,_runSchema:P,_updateIsValidating:y,_focusError:Q,_getWatch:ee,_getDirty:$,_setValid:v,_setFieldArray:S,_setDisabledField:Y,_setErrors:x,_getFieldArray:H,_reset:$e,_resetDefaultValues:()=>Et(t.defaultValues)&&t.defaultValues().then(w=>{We(w,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:M,_disableForm:Ce,_subjects:p,_proxyFormState:f,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(w){o=w},get _defaultValues(){return s},get _names(){return a},set _names(w){a=w},get _formState(){return r},get _options(){return t},set _options(w){t={...t,...w}}},subscribe:ve,trigger:F,register:ce,handleSubmit:qe,watch:me,setValue:pe,setValues:ae,getValues:B,reset:We,resetField:et,resetDefaultValues:(w,A={})=>{if(s=Xe(w),!A.keepDirty){const I=Xr(s,i);r.dirtyFields=I,r.isDirty=!ft(I)}A.keepIsValid||v(),p.state.next({...r,defaultValues:s})},clearErrors:he,unregister:Te,setError:be,setFocus:tt,getFieldState:Z};return{...Kr,formControl:Kr}}function cO(e={}){const t=g.useRef(void 0),r=g.useRef(void 0),n=g.useRef(e.formControl),[s,i]=g.useState(()=>({...Xe($p),isLoading:Et(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Et(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!Et(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...c}=lO(e);t.current={...c,formState:s}}const o=t.current.control;return o._options=e,Kl(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>i({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return i(c=>({...c,isReady:!0})),o._formState.isReady=!0,a},[o]),g.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),g.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),g.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),g.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),g.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==s.isDirty&&o._subjects.state.next({isDirty:a})}},[o,s.isDirty]),g.useEffect(()=>{var a;e.values&&!zt(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),r.current=e.values,i(c=>({...c}))):o._resetDefaultValues()},[o,e.values]),g.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=g.useMemo(()=>Np(s,o),[o,s]),t.current}function uO(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),i=(t??[]).filter(d=>!s.has(d)),{data:o}=Jn({queryKey:["framework-search",i.sort().join(","),r],queryFn:()=>w0({type:i,systemDefault:"Yes"}),enabled:i.length>0,staleTime:600*1e3}),a=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,c=[...(o??[]).map(d=>({label:d.name,value:d.identifier})),...a.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return c.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function Up(e){var r,n;return(n=(r=(await Fe.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function dO(e){var r,n,s,i,o,a,c;const t=Jn({queryKey:["channel",e],queryFn:()=>Up(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(s=t.data)==null?void 0:s.frameworks,collectionAdditionalCategories:(i=t.data)==null?void 0:i.collectionAdditionalCategories,contentAdditionalCategories:(o=t.data)==null?void 0:o.contentAdditionalCategories,defaultLicense:(a=t.data)==null?void 0:a.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function fO(e){const{data:t}=Jn({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>H0(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const zp=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],hO={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."}},pO=new Set(["review","read","sourcingreview","orgreview"]),Si={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},mO={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},gO={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},ui={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},Jl=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]);function Vp(e,t,r,n,s={}){if(!(e!=null&&e.length))return yd(PO(t,n,r,s),r,t,n,s);const i=new Map;for(const c of e){const u=c.code;u&&!i.has(u)&&i.set(u,c)}const o=new Set,a=e.filter(c=>{var d;if(n&&(c.code==="dialCode"||c.code==="dialcode")||((d=s.profile)==null?void 0:d.key)==="learningPath"&&Jl.has(c.code)||c.visible===!1)return!1;const u=c.code;return o.has(u)?!1:(o.add(u),!0)}).map(c=>{const u=c.code??"",d=wO(c),f=xO(c,r,t,i,s),m=t[u],p=yO(u,Hp(m,d),d,t,s),b={code:u,label:c.label??u,inputType:d,required:!!(c.required===!0||Array.isArray(c.validations)&&c.validations.some(h=>h.type==="required")),editable:vO(u,c.editable!==!1,s),placeholder:c.placeholder,maxLength:c.maxLength,options:SO(f,p,d,r),depends:c.depends,tab:_O(c),section:c.section,sourceCategory:c.sourceCategory,defaultValue:c.defaultValue??c.default,currentValue:p};if(u==="dialcodes"){const h=t.dialcodeRequired==="Yes";return{...b,required:h,visible:h}}return b});return yd(a,r,t,n,s)}function yd(e,t,r,n,s){var i;return((i=s.profile)==null?void 0:i.key)==="learningPath"?jO(e,t,r,n):NO(e,t,r,n)}function vO(e,t,r){var i;const n=r.editorMode??"edit";if(!pO.has(n))return t!==!1;const s=(i=r.editableFields)==null?void 0:i[n];return!!(s&&s.includes(e))}function yO(e,t,r,n,s){const i=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return i?s.defaultLicense??"":t;case"copyright":return i&&s.channelName?s.channelName:t;case"copyrightYear":return i?String(new Date().getFullYear()):t;case"author":case"creator":return i&&s.userFullName?s.userFullName:t;case"instructions":{const o=n.instructions;return o&&typeof o=="object"&&!Array.isArray(o)?o.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!i)return t;const o=n.timeLimits,a=o==null?void 0:o[e];return a!=null&&a!==""?bO(Number(a)):t}default:return t}}function bO(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),s=i=>String(i).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function CO(e){var n,s,i;const t=new Map,r=o=>o==null?void 0:o.forEach(a=>{a.identifier&&t.set(a.identifier,a.name),a.name&&t.set(a.name,a.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(o=>r(o.terms)),(i=e.targetFrameworks)==null||i.forEach(o=>{var a;return(a=o.categories)==null?void 0:a.forEach(c=>r(c.terms))}),t}function SO(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const i=e?[...e]:[],o=new Set(i.map(c=>c.value)),a=CO(n);for(const c of s){const u=String(c);o.has(u)||(i.push({label:a.get(u)??u,value:u}),o.add(u))}return i}function _O(e){const t=e.section;if(t){if(Si[t])return Si[t];const n=mO[t];if(n&&Si[n])return Si[n]}const r=e.code??"";return gO[r]??"details"}function Hp(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function wO(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function xO(e,t,r,n,s){var u;const i=e.code??"";if(((u=s.profile)==null?void 0:u.key)==="learningPath"&&i==="policy")return zp;if(i==="maxQuestions"){const d=s.childCount??0;if(d>0)return Array.from({length:d},(f,m)=>({label:String(m+1),value:String(m+1)}))}const o=e.range;if(Array.isArray(o)&&o.length)return typeof o[0]=="string"?o.map(d=>({label:d,value:d})):o.map(d=>({label:d.name,value:d.identifier}));const a=e.enum;if(a!=null&&a.length)return a.map(d=>({label:d,value:d}));if(i==="framework")return t.orgFrameworks;if(i==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,m=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return m!=null&&m.length?kO(m).map(p=>({label:p,value:p})):void 0}const c=e.sourceCategory??ui[i];if(c)return Qp(i,c,e,t,r,n)}function TO(e,t){return Jl.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function EO(e,t){return Jl.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function ha(e,t,r){var i,o,a,c,u;const n=(o=(i=e.organisationFramework)==null?void 0:i.categories)==null?void 0:o.find(d=>d.code===t),s=(u=(c=(a=e.targetFrameworks)==null?void 0:a[0])==null?void 0:c.categories)==null?void 0:u.find(d=>d.code===t);return r?(s==null?void 0:s.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(s==null?void 0:s.terms)??[]}function AO(e){const t=new Set,r=[];for(const n of e){const s=n.identifier??n.name;s&&!t.has(s)&&(t.add(s),r.push(n))}return r}function kO(e){return Array.from(new Set(e))}function IO(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Qp(e,t,r,n,s,i){const o=TO(e,r),a=EO(e,r),c=h=>({label:h.name,value:o?h.identifier:h.name}),u=r.depends;if(!(u!=null&&u.length))return ha(n,t,a).map(c);const d=u.flatMap(h=>IO(s[h])).map(String);if(!d.length)return[];const f=[];for(const h of u){const v=i.get(h),y=(v==null?void 0:v.sourceCategory)??ui[h]??h;f.push(...ha(n,y,a))}const p=f.filter(h=>d.includes(String(h.name))||d.includes(String(h.identifier))||d.includes(String(h.code))).flatMap(h=>h.associations??[]).filter(h=>String(h.category??"").toLowerCase()===t.toLowerCase()),b=AO(p);return b.length?b.map(c):ha(n,t,a).map(c)}function Ss(e,t){const r=ui[e];if(r)return Qp(e,r,{},t,{},new Map)}function Ye(e,t,r){return Hp(e[t],r)}const DO=["board","medium","gradeLevel","subject"];function LO(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>DO.includes(n.code)):!0}function OO(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(i=>i.code===t)||(s=e.targetFrameworks)!=null&&s.some(i=>{var o;return(o=i.categories)==null?void 0:o.some(a=>a.code===t)}))}function NO(e,t,r,n){var c;if(!n||LO(t))return e;const s=e.filter(u=>{const d=u.sourceCategory??ui[u.code];return!d||OO(t,d)}),i=new Set(s.map(u=>u.code)),o=[];for(const u of((c=t.organisationFramework)==null?void 0:c.categories)??[])i.has(u.code)||o.push({code:u.code,label:u.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",options:(u.terms??[]).map(d=>({label:d.name,value:d.name})),currentValue:Ye(r,u.code,"multiselect")});if(!o.length)return s;const a=s.findIndex(u=>u.code==="framework");return a>=0?[...s.slice(0,a+1),...o,...s.slice(a+1)]:[...s,...o]}const pa="Organisation Framework Terms";function jO(e,t,r,n){var m,p;if(!n)return e;const s=[...((m=t.organisationFramework)==null?void 0:m.categories)??[]].sort((b,h)=>(b.index??1/0)-(h.index??1/0));if(!s.length)return e;const i=(p=jh(s))==null?void 0:p.code,o=b=>b.sourceCategory??ui[b.code];let c=e.filter(b=>{const h=o(b);return h?h!==i&&s.some(v=>v.code===h):!0}).map(b=>o(b)?{...b,section:pa,required:!0,inputType:"select",currentValue:Ye(r,b.code,"select")}:b),u=c.findIndex(b=>b.code==="framework");if(u===-1){const b={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:pa,options:t.orgFrameworks,currentValue:Ye(r,"framework","select")},h=c.findIndex(v=>!!o(v));u=h>=0?h:c.length,c=[...c.slice(0,u),b,...c.slice(u)]}const d=new Set(c.map(b=>b.code)),f=s.filter(b=>b.code!==i&&!d.has(b.code)).map(b=>({code:b.code,label:b.name,inputType:"select",required:!0,editable:!0,tab:"details",section:pa,options:(b.terms??[]).map(h=>({label:h.name,value:h.name})),currentValue:Ye(r,b.code,"select")}));return f.length?[...c.slice(0,u+1),...f,...c.slice(u+1)]:c}function PO(e,t,r,n={}){var i,o;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:Ye(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:Ye(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:Ye(e,"keywords","chips")}];return t?((i=n.profile)==null?void 0:i.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ye(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:zp,currentValue:Ye(e,"policy","select")||"strict"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:Ye(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:Ye(e,"additionalCategories","multiselect"),options:(o=r.channelAdditionalCategories)==null?void 0:o.map(a=>({label:a,value:a}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:Ye(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:Ss("subjectIds",r),currentValue:Ye(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:Ye(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:Ss("targetBoardIds",r),currentValue:Ye(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:Ss("targetMediumIds",r),currentValue:Ye(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:Ss("targetGradeLevelIds",r),currentValue:Ye(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:Ss("targetSubjectIds",r),currentValue:Ye(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:Ye(e,"license","select")}),s):s}const RO=["allowECM","levels","setPeriod","instances"];function Wp(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function FO(e,t={}){const r={...e};for(const i of RO)delete r[i];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Wp(n)});const s=e.instances;return s!=null&&s!==""&&(r.instances={label:s}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function MO(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Wp(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function BO(e,t){const{watch:r,setValue:n}=e,s=g.useRef(!1);g.useEffect(()=>{const i=r((o,{name:a})=>{var c;if(!(!a||s.current)){s.current=!0;try{const u=new Set([a]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(c=f.depends)!=null&&c.some(m=>u.has(m))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>i.unsubscribe()},[r,n,t])}const qO="_section_qa0tm_1",$O="_header_qa0tm_11",UO="_title_qa0tm_17",zO="_description_qa0tm_24",VO="_divider_qa0tm_30",HO="_fields_qa0tm_36",Nn={section:qO,header:$O,title:UO,description:zO,divider:VO,fields:HO},QO=({title:e,description:t,children:r})=>l.jsxs("div",{className:Nn.section,children:[l.jsxs("div",{className:Nn.header,children:[l.jsx("h3",{className:Nn.title,children:e}),t&&l.jsx("p",{className:Nn.description,children:t})]}),l.jsx("hr",{className:Nn.divider}),l.jsx("div",{className:Nn.fields,children:r})]}),WO="_field_93co8_1",GO="_fullWidth_93co8_7",KO="_label_93co8_11",YO="_required_93co8_19",ZO="_input_93co8_24",XO="_textarea_93co8_45",JO="_inputError_93co8_50",eN="_error_93co8_54",tN="_selectBtn_93co8_59",rN="_selectOpen_93co8_83",nN="_placeholder_93co8_87",sN="_selectedVal_93co8_91",iN="_chevronUp_93co8_95",oN="_dropdown_93co8_100",aN="_option_93co8_116",lN="_optionSelected_93co8_134",cN="_noOpts_93co8_139",uN="_chipGroup_93co8_146",dN="_chipInput_93co8_158",fN="_addChipBtn_93co8_167",hN="_radioGroup_93co8_184",pN="_radioLabel_93co8_191",mN="_iconWrap_93co8_199",gN="_iconPreview_93co8_214",vN="_iconPlaceholder_93co8_220",yN="_removeIconBtn_93co8_233",bN="_tagChip_93co8_252",CN="_tagChipRemove_93co8_264",SN="_nestedSelectRow_93co8_278",_N="_dialcodeRow_93co8_287",wN="_validateBtn_93co8_293",xN="_dialcodeValid_93co8_315",TN="_dialcodeSpinner_93co8_325",q={field:WO,fullWidth:GO,label:KO,required:YO,input:ZO,textarea:XO,inputError:JO,error:eN,selectBtn:tN,selectOpen:rN,placeholder:nN,selectedVal:sN,chevronUp:iN,dropdown:oN,option:aN,optionSelected:lN,noOpts:cN,chipGroup:uN,chipInput:dN,addChipBtn:fN,radioGroup:hN,radioLabel:pN,iconWrap:mN,iconPreview:gN,iconPlaceholder:vN,removeIconBtn:yN,tagChip:bN,tagChipRemove:CN,nestedSelectRow:SN,dialcodeRow:_N,validateBtn:wN,dialcodeValid:xN,dialcodeSpinner:TN},bd=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:i,placeholder:o})=>{const a=oe(),{register:c,formState:{errors:u}}=Jt(),d=u[e],f={required:r?a.textField.requiredError.replace("{field}",t):!1,maxLength:i?{value:i,message:a.textField.maxLengthError.replace("{max}",String(i))}:void 0};return l.jsxs("div",{className:[q.field,s?q.fullWidth:""].join(" "),children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[q.input,q.textarea,d?q.inputError:""].join(" "),disabled:n,placeholder:o,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[q.input,d?q.inputError:""].join(" "),disabled:n,placeholder:o,...c(e,f)}),d&&l.jsx("span",{className:q.error,children:String(d.message)})]})},EN=({name:e,label:t,options:r,required:n,disabled:s})=>{var v;const i=oe(),[o,a]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:m}}=Jt(),p=d(e),b=((v=r.find(y=>y.value===p))==null?void 0:v.label)??i.selectField.selectPlaceholder,h=m[e];return g.useEffect(()=>{if(!o)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]),l.jsxs("div",{className:q.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?i.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[q.selectBtn,h?q.inputError:"",o?q.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:p?q.selectedVal:q.placeholder,children:b}),l.jsx(Cn,{size:14,className:o?q.chevronUp:""})]}),o&&l.jsxs("div",{className:q.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[q.option,p===y.value?q.optionSelected:""].join(" "),onClick:()=>{f(e,y.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:y.label}),p===y.value&&l.jsx(bn,{size:13})]},y.value)),!r.length&&l.jsx("span",{className:q.noOpts,children:i.selectField.noOptionsMessage})]}),h&&l.jsx("span",{className:q.error,children:String(h.message)})]})},AN=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=oe(),[o,a]=g.useState(!1),c=g.useRef(null),{register:u,watch:d,setValue:f,formState:{errors:m}}=Jt(),p=d(e)??[],b=m[e],h=p.length?`${p.length} ${i.multiSelectField.selectedCountSuffix}`:i.multiSelectField.selectPlaceholder;g.useEffect(()=>{if(!o)return;const y=C=>{var S;(S=c.current)!=null&&S.contains(C.target)||a(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[o]);const v=y=>{const C=p.includes(y)?p.filter(S=>S!==y):[...p,y];f(e,C,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:q.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...u(e,{required:n?i.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[q.selectBtn,b?q.inputError:"",o?q.selectOpen:""].join(" "),onClick:()=>a(y=>!y),children:[l.jsx("span",{className:p.length?q.selectedVal:q.placeholder,children:h}),l.jsx(Cn,{size:14,className:o?q.chevronUp:""})]}),o&&l.jsxs("div",{className:q.dropdown,children:[r.map(y=>l.jsxs("button",{type:"button",className:[q.option,p.includes(y.value)?q.optionSelected:""].join(" "),onClick:()=>v(y.value),children:[l.jsx(bn,{size:13,style:{opacity:p.includes(y.value)?1:0}}),l.jsx("span",{children:y.label})]},y.value)),!r.length&&l.jsx("span",{className:q.noOpts,children:i.multiSelectField.noOptionsMessage})]}),b&&l.jsx("span",{className:q.error,children:String(b.message)})]})},kN=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const i=oe(),o=s??i.chipGroupField.addPlaceholder,[a,c]=g.useState(""),[u,d]=g.useState(!1),f=g.useRef(null),{watch:m,setValue:p,formState:{errors:b}}=Jt(),h=m(e)??[],v=b[e],y=()=>{const S=a.trim();S&&!h.includes(S)&&p(e,[...h,S],{shouldDirty:!0}),c(""),d(!1)},C=S=>p(e,h.filter(_=>_!==S),{shouldDirty:!0});return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:q.chipGroup,children:[h.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>C(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(u?l.jsx("input",{ref:f,autoFocus:!0,className:q.chipInput,value:a,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),d(!1))},onBlur:y,placeholder:o}):l.jsxs("button",{type:"button",className:q.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Sn,{size:12})," ",i.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:q.error,children:String(v.message)})]})},IN=({name:e,label:t,options:r,required:n,disabled:s})=>{const i=oe(),{register:o,formState:{errors:a}}=Jt(),c=a[e];return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("div",{className:q.radioGroup,children:r.map(u=>l.jsxs("label",{className:q.radioLabel,children:[l.jsx("input",{type:"radio",value:u.value,disabled:s,...o(e,{required:n?i.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),c&&l.jsx("span",{className:q.error,children:String(c.message)})]})};async function DN(e,t,r,n){var o,a;const i=(a=(o=(await Fe.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:o.result)==null?void 0:a.node_id;if(!i)throw new Error("Asset creation failed: no node_id returned");return i}async function LN(e,t){var s,i;const n=(i=(s=(await Fe.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:i.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function ON(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function NN(e,t,r){var o,a;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const i=(a=(o=(await Fe.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:o.result)==null?void 0:a.content_url;if(!i)throw new Error("Asset finalize failed: no content_url returned");return i}const jN="_overlay_1bq5u_1",PN="_modal_1bq5u_12",RN="_header_1bq5u_24",FN="_title_1bq5u_33",MN="_closeBtn_1bq5u_39",BN="_tabs_1bq5u_57",qN="_tab_1bq5u_57",$N="_activeTab_1bq5u_83",UN="_body_1bq5u_88",zN="_searchWrap_1bq5u_99",VN="_searchIcon_1bq5u_104",HN="_searchInput_1bq5u_113",QN="_grid_1bq5u_132",WN="_imgCell_1bq5u_148",GN="_imgCellSelected_1bq5u_166",KN="_thumb_1bq5u_171",YN="_noThumb_1bq5u_177",ZN="_checkBadge_1bq5u_183",XN="_loadMoreBtn_1bq5u_198",JN="_loadingRow_1bq5u_220",ej="_empty_1bq5u_230",tj="_spinner_1bq5u_237",rj="_uploadArea_1bq5u_247",nj="_dropZone_1bq5u_256",sj="_uploadIcon_1bq5u_277",ij="_dropText_1bq5u_281",oj="_dropSubtext_1bq5u_288",aj="_uploadPreview_1bq5u_294",lj="_hiddenInput_1bq5u_301",cj="_fileName_1bq5u_305",uj="_errorText_1bq5u_311",dj="_footer_1bq5u_318",fj="_cancelBtn_1bq5u_328",hj="_confirmBtn_1bq5u_345",Ee={overlay:jN,modal:PN,header:RN,title:FN,closeBtn:MN,tabs:BN,tab:qN,activeTab:$N,body:UN,searchWrap:zN,searchIcon:VN,searchInput:HN,grid:QN,imgCell:WN,imgCellSelected:GN,thumb:KN,noThumb:YN,checkBadge:ZN,loadMoreBtn:XN,loadingRow:JN,empty:ej,spinner:tj,uploadArea:rj,dropZone:nj,uploadIcon:sj,dropText:ij,dropSubtext:oj,uploadPreview:aj,hiddenInput:lj,fileName:cj,errorText:uj,footer:dj,cancelBtn:fj,confirmBtn:hj},Cd=18,Gp=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=oe(),[i,o]=g.useState("my"),[a,c]=g.useState(""),[u,d]=g.useState([]),[f,m]=g.useState(0),[p,b]=g.useState(!1),[h,v]=g.useState(null),[y,C]=g.useState(0),[S,_]=g.useState(null),[x,E]=g.useState(""),[D,T]=g.useState(!1),[j,P]=g.useState(""),O=g.useRef(null),N=K(F=>{var B,Z;return((Z=(B=F.editorConfig)==null?void 0:B.context)==null?void 0:Z.channel)??""}),R=K(F=>{var B,Z;return((Z=(B=F.editorConfig)==null?void 0:B.context)==null?void 0:Z.uid)??""}),M=K(F=>{var B,Z,he;return((he=(Z=(B=F.editorConfig)==null?void 0:B.context)==null?void 0:Z.cloudStorage)==null?void 0:he.presigned_headers)??{}}),$=K(F=>{var B,Z,he;return((he=(Z=(B=F.editorConfig)==null?void 0:B.config)==null?void 0:Z.assetConfig)==null?void 0:he.size)??1*1024*1024}),ee=K(F=>{var B,Z,he;return((he=(Z=(B=F.editorConfig)==null?void 0:B.config)==null?void 0:Z.assetConfig)==null?void 0:he.accepted)??"image/png,image/jpeg"}),H=g.useCallback(async(F,B,Z=!1)=>{var he;b(!0);try{const be={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};i==="my"&&R&&(be.createdBy=R),N&&(be.channel=N);const le=((he=(await Fe.post("/action/composite/v3/search",{request:{filters:be,query:F,limit:Cd,offset:B,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:he.result)??{},ve=le.content??[];m(le.count??0),d(Te=>Z?[...Te,...ve]:ve)}catch{}finally{b(!1)}},[i,R,N]);g.useEffect(()=>{i!=="upload"&&(d([]),C(0),H(a,0))},[i]);const te=g.useRef(),de=F=>{c(F),clearTimeout(te.current),te.current=setTimeout(()=>{d([]),C(0),H(F,0)},400)},fe=()=>{const F=y+Cd;C(F),H(a,F,!0)},pe=()=>{const F=(h==null?void 0:h.artifactUrl)??(h==null?void 0:h.appIcon)??(h==null?void 0:h.downloadUrl)??"";F&&r(F)};g.useEffect(()=>()=>{x&&URL.revokeObjectURL(x)},[x]);const ae=F=>{var he;const B=(he=F.target.files)==null?void 0:he[0];if(F.target.value="",!B)return;const Z=ee.split(",").map(be=>be.trim());if(!Z.includes(B.type)){const be=Z.map(me=>me.replace("image/","").toUpperCase()).join(", ");P(s.appIconPickerModal.invalidFileTypeError.replace("{types}",be));return}if(B.size>$){const be=($/1048576).toFixed(0);P(s.appIconPickerModal.fileTooLargeError.replace("{size}",be));return}x&&URL.revokeObjectURL(x),_(B),E(URL.createObjectURL(B)),P("")},we=async()=>{if(S){T(!0),P("");try{const F=await DN(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,R,N),B=await LN(F,S.name);await ON(B,S,M);const Z=B.split("?")[0],he=await NN(F,Z,S.type);r(he)}catch(F){P(F instanceof Error?F.message:s.appIconPickerModal.uploadFailedError)}finally{T(!1)}}},ye=u.length<f;return l.jsx("div",{className:Ee.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:Ee.modal,children:[l.jsxs("div",{className:Ee.header,children:[l.jsx("span",{className:Ee.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:Ee.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(br,{size:18})})]}),l.jsxs("div",{className:Ee.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":i==="my",className:`${Ee.tab} ${i==="my"?Ee.activeTab:""}`,onClick:()=>o("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":i==="all",className:`${Ee.tab} ${i==="all"?Ee.activeTab:""}`,onClick:()=>o("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":i==="upload",className:`${Ee.tab} ${i==="upload"?Ee.activeTab:""}`,onClick:()=>o("upload"),children:[l.jsx(Ma,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:Ee.body,children:i!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ee.searchWrap,children:[l.jsx(Yi,{size:14,className:Ee.searchIcon}),l.jsx("input",{type:"search",className:Ee.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:a,onChange:F=>de(F.target.value)})]}),p&&u.length===0?l.jsxs("div",{className:Ee.loadingRow,children:[l.jsx(ki,{size:20,className:Ee.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?l.jsx("div",{className:Ee.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:Ee.grid,children:u.map(F=>{const B=F.appIcon??F.artifactUrl??F.downloadUrl??"",Z=(h==null?void 0:h.identifier)===F.identifier;return l.jsxs("button",{type:"button",className:`${Ee.imgCell} ${Z?Ee.imgCellSelected:""}`,onClick:()=>v(F),title:F.name,children:[B?l.jsx("img",{src:B,alt:F.name,className:Ee.thumb}):l.jsx("div",{className:Ee.noThumb,children:s.appIconPickerModal.noThumbnailText}),Z&&l.jsx("div",{className:Ee.checkBadge,children:l.jsx(bn,{size:12})})]},F.identifier)})}),ye&&!p&&l.jsx("button",{className:Ee.loadMoreBtn,onClick:fe,children:s.appIconPickerModal.loadMoreButton}),p&&u.length>0&&l.jsx("div",{className:Ee.loadingRow,children:l.jsx(ki,{size:16,className:Ee.spinner})})]}):l.jsxs("div",{className:Ee.uploadArea,children:[l.jsx("div",{className:Ee.dropZone,onClick:()=>{var F;return(F=O.current)==null?void 0:F.click()},onDragOver:F=>F.preventDefault(),onDrop:F=>{F.preventDefault();const B=F.dataTransfer.files[0];B&&ae({target:{files:[B],value:""}})},children:x?l.jsx("img",{src:x,alt:s.appIconPickerModal.previewAlt,className:Ee.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(Ma,{size:32,className:Ee.uploadIcon}),l.jsx("p",{className:Ee.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:Ee.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",ee.split(",").map(F=>F.replace("image/","").toUpperCase()).join(", ")).replace("{size}",($/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:O,type:"file",accept:ee,className:Ee.hiddenInput,onChange:ae}),S&&l.jsx("p",{className:Ee.fileName,children:S.name}),j&&l.jsx("p",{className:Ee.errorText,children:j})]})}),l.jsxs("div",{className:Ee.footer,children:[l.jsx("button",{className:Ee.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),i==="upload"?l.jsx("button",{className:Ee.confirmBtn,disabled:!S||D,onClick:we,children:D?l.jsxs(l.Fragment,{children:[l.jsx(ki,{size:14,className:Ee.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:Ee.confirmBtn,disabled:!h,onClick:pe,children:s.appIconPickerModal.useSelectedButton})]})]})})},pj=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const i=oe(),[o,a]=g.useState(!1),{watch:c,setValue:u,register:d,formState:{errors:f}}=Jt(),m=c(e),p=f[e],b=v=>{u(e,v,{shouldDirty:!0,shouldValidate:!0}),a(!1)},h=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?i.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:q.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":i.appIconField.selectIconAriaLabel,onClick:()=>!s&&a(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&a(!0)},children:m?l.jsx("img",{src:m,alt:i.appIconField.iconAlt,className:q.iconPreview}):l.jsxs("div",{className:q.iconPlaceholder,children:[l.jsx($f,{size:20}),l.jsx("span",{children:i.appIconField.selectIconLabel})]})}),m&&!s&&l.jsxs("button",{type:"button",className:q.removeIconBtn,onClick:h,"aria-label":i.appIconField.removeIconAriaLabel,children:[l.jsx(So,{size:13}),l.jsx("span",{children:i.appIconField.removeLabel})]}),p&&l.jsx("span",{className:q.error,children:String(p.message)}),o&&l.jsx(Gp,{nodeId:r,currentValue:m,onSelect:b,onClose:()=>a(!1)})]})},mj=({name:e,label:t,required:r,disabled:n})=>{const s=oe(),{control:i}=Jt(),{field:o,fieldState:{error:a}}=ci({name:e,control:i,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[q.input,a?q.inputError:""].join(" "),disabled:n,value:o.value??"",onChange:o.onChange,onBlur:o.onBlur,ref:o.ref}),a&&l.jsx("span",{className:q.error,children:String(a.message)})]})},gj=({name:e,label:t,required:r,disabled:n})=>{const s=oe(),{control:i}=Jt(),{field:o,fieldState:{error:a}}=ci({name:e,control:i,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,u]=g.useState(""),d=g.useRef(null),f=o.value??[],m=v=>{const y=v.trim();!y||f.includes(y)||o.onChange([...f,y])},p=v=>{o.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m(c),u("")):v.key==="Backspace"&&c===""&&f.length>0&&p(f[f.length-1])},h=()=>{c.trim()&&(m(c),u("")),o.onBlur()};return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:[q.chipGroup,a?q.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=d.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:q.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:q.tagChipRemove,onClick:y=>{y.stopPropagation(),p(v)},"aria-label":`Remove ${v}`,children:l.jsx(br,{size:11})})]},v)),!n&&l.jsx("input",{ref:d,className:q.chipInput,value:c,onChange:v=>u(v.target.value),onKeyDown:b,onBlur:h,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),a&&l.jsx("span",{className:q.error,children:String(a.message)})]})},vj=({name:e,label:t,levels:r,required:n,disabled:s})=>{const i=oe(),{control:o}=Jt(),{field:a,fieldState:{error:c}}=ci({name:e,control:o,rules:{required:n?i.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=a.value??{},d=(f,m,p)=>{const b={};for(let h=0;h<m;h++)b[r[h].code]=u[r[h].code]??"";b[f]=p;for(let h=m+1;h<r.length;h++)b[r[h].code]="";a.onChange(b)};return l.jsxs("div",{className:[q.field,q.fullWidth].join(" "),children:[l.jsxs("label",{className:q.label,children:[t,n&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("div",{className:q.nestedSelectRow,children:r.map((f,m)=>{const p=m>0&&!u[r[m-1].code];return l.jsxs("div",{className:q.field,style:{flex:1},children:[l.jsx("label",{className:q.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[q.input,c?q.inputError:""].join(" "),disabled:s||p,value:u[f.code]??"",onChange:b=>d(f.code,m,b.target.value),onBlur:a.onBlur,children:[l.jsx("option",{value:"",children:i.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:q.error,children:String(c.message)})]})},Sd=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],yj=({name:e,label:t,required:r,disabled:n})=>{const s=oe(),[i,o]=g.useState(!1),a=g.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=Jt(),m=u(e),p=Sd.find(v=>v.value===m),b=(p==null?void 0:p.label)??s.licenseSelectField.selectPlaceholder,h=f[e];return g.useEffect(()=>{if(!i)return;const v=y=>{var C;(C=a.current)!=null&&C.contains(y.target)||o(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[i]),l.jsxs("div",{className:q.field,ref:a,style:{position:"relative"},children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[q.selectBtn,h?q.inputError:"",i?q.selectOpen:""].join(" "),onClick:()=>o(v=>!v),"aria-haspopup":"listbox","aria-expanded":i,children:[l.jsx("span",{className:m?q.selectedVal:q.placeholder,children:b}),l.jsx(Cn,{size:14,className:i?q.chevronUp:""})]}),i&&l.jsx("div",{className:q.dropdown,role:"listbox",children:Sd.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":m===v.value,className:[q.option,m===v.value?q.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),o(!1)},children:[l.jsx("span",{children:v.label}),m===v.value&&l.jsx(bn,{size:13})]},v.value))}),h&&l.jsx("span",{className:q.error,children:String(h.message)})]})},bj=({name:e,label:t,required:r,disabled:n})=>{const s=oe(),{control:i}=Jt(),{field:o,fieldState:{error:a}}=ci({name:e,control:i,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,u]=g.useState("idle"),[d,f]=g.useState(""),m=async()=>{const b=(o.value??"").trim();if(!b){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const h=await CT(b),v=h==null?void 0:h.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},p=()=>c==="loading"?l.jsx(ki,{size:16,className:q.dialcodeSpinner}):c==="valid"?l.jsx(Rf,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Ty,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsxs("div",{className:q.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[q.input,a?q.inputError:""].join(" "),disabled:n,value:o.value??"",onChange:b=>{o.onChange(b),u("idle"),f("")},onBlur:o.onBlur,ref:o.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:q.validateBtn,onClick:m,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),p()]}),a&&l.jsx("span",{className:q.error,children:String(a.message)}),!a&&d&&l.jsx("span",{className:c==="valid"?q.dialcodeValid:q.error,children:d})]})},Cj="_cards_1oc2m_1",Sj="_card_1oc2m_1",_j="_cardActive_1oc2m_30",wj="_cardIcon_1oc2m_35",xj="_cardIconPrimary_1oc2m_46",Tj="_cardIconHover_1oc2m_50",Ej="_radioDot_1oc2m_54",Aj="_radioDotActive_1oc2m_65",kj="_cardTitle_1oc2m_70",Ij="_cardTitleInk_1oc2m_76",Dj="_cardDescription_1oc2m_80",Lj="_cardDescriptionCharcoal_1oc2m_86",Bt={cards:Cj,card:Sj,cardActive:_j,cardIcon:wj,cardIconPrimary:xj,cardIconHover:Tj,radioDot:Ej,radioDotActive:Aj,cardTitle:kj,cardTitleInk:Ij,cardDescription:Dj,cardDescriptionCharcoal:Lj},Oj=({name:e,label:t,required:r,disabled:n})=>{const s=oe(),{control:i}=Jt(),o=[{value:"strict",Icon:Uf,iconVariant:Bt.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:Ky,iconVariant:Bt.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:Bt.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:q.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:Bt.cardDescriptionCharcoal},{value:"priorLearning",Icon:Uy,iconVariant:Bt.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:q.field,children:[l.jsxs("label",{className:q.label,children:[t,r&&l.jsx("span",{className:q.required,children:"*"})]}),l.jsx(WL,{name:e,control:i,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:a})=>l.jsx("div",{className:Bt.cards,children:o.map(({value:c,Icon:u,iconVariant:d,title:f,titleVariant:m,description:p,descriptionVariant:b})=>{const h=a.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[Bt.card,h?Bt.cardActive:""].join(" "),onClick:()=>a.onChange(c),children:[l.jsx("span",{className:[Bt.cardIcon,d].join(" "),children:l.jsx(u,{size:16})}),l.jsx("span",{className:[Bt.radioDot,h?Bt.radioDotActive:""].join(" ")}),l.jsx("span",{className:[Bt.cardTitle,m].join(" "),children:f}),l.jsx("span",{className:[Bt.cardDescription,b].join(" "),children:p})]},c)})})})]})},Nj="_form_lktqh_1",jj="_formLp_lktqh_7",Pj="_ungrouped_lktqh_12",Rj="_ungroupedLp_lktqh_23",Fj="_fullWidthField_lktqh_27",Mj="_noFields_lktqh_31",jn={form:Nj,formLp:jj,ungrouped:Pj,ungroupedLp:Rj,fullWidthField:Fj,noFields:Mj},Bj=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:i,onFormStatusChange:o})=>{var qe,et,$e,We,tt,Gr,wn,cs,Kr;const a=oe(),c=K(w=>w.editorConfig),u=K(w=>w.editorProfile),d=u.key==="learningPath",f=K(w=>w.rootFormConfig),m=K(w=>w.unitFormConfig),p=K(w=>w.categoryMeta),b=K(w=>w.contentFramework),h=K(w=>w.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=Ao(b??((qe=c==null?void 0:c.context)==null?void 0:qe.framework),h??((et=c==null?void 0:c.context)==null?void 0:et.targetFWIds)),{frameworks:S,collectionAdditionalCategories:_,contentAdditionalCategories:x,defaultLicense:E,name:D}=dO(($e=c==null?void 0:c.context)==null?void 0:$e.channel),T=fO(((We=c==null?void 0:c.context)==null?void 0:We.userId)??((tt=c==null?void 0:c.context)==null?void 0:tt.uid)),j=uO(S,(Gr=p==null?void 0:p.frameworkMetadata)==null?void 0:Gr.orgFWType,(wn=c==null?void 0:c.context)==null?void 0:wn.channel),P={organisationFramework:v,targetFrameworks:y,orgFrameworks:j,channelAdditionalCategories:_},O=re(w=>w.selectedNodeId),N=re(w=>w.treeData),R=re(w=>w.treeCache),M=O?R[O]??{}:{},$={...e,...M},ee=g.useMemo(()=>{var A;if(!O)return 0;const w=[...N];for(;w.length;){const I=w.shift();if(I.id===O)return((A=I.children)==null?void 0:A.length)??0;I.children&&w.push(...I.children)}return 0},[N,O]),H=(c==null?void 0:c.config)??{},te=(c==null?void 0:c.context)??{},de={editorMode:s,editableFields:H.editableFields,objectType:H.objectType,setDefaultCopyRight:H.setDefaultCopyRight===!0,defaultLicense:te.defaultLicense??E,contextAdditionalCategories:te.additionalCategories,userFullName:((cs=te.user)==null?void 0:cs.fullName)??T,channelName:D,collectionAdditionalCategories:_,contentAdditionalCategories:x,childCount:ee,profile:u},fe=r?f:m,pe=fe||(((Kr=c==null?void 0:c.config.hierarchy)==null?void 0:Kr.formConfig)??[]),ae=Vp(pe,$,P,r,de),we=ae.filter(w=>w.tab===t&&w.inputType!=="appIcon"&&w.visible!==!1),ye=cO({mode:"onChange",defaultValues:Object.fromEntries(ae.map(w=>{const A=["multiselect","chips","keywords","tagsinput"],I=["nestedselect"];return A.includes(w.inputType)?[w.code,w.currentValue??w.defaultValue??[]]:I.includes(w.inputType)?[w.code,w.currentValue??w.defaultValue??{}]:[w.code,w.currentValue??w.defaultValue??""]}))});BO(ye,ae);const{updateNode:F}=re(),B=g.useRef(ae);B.current=ae;const Z=g.useRef(O);Z.current=O;const he=g.useRef(i);he.current=i;const be=g.useRef(o);be.current=o;const me=g.useRef(typeof $.shuffle=="boolean"?$.shuffle:void 0),le=g.useRef($.name??"");le.current=$.name??"";const ve=g.useRef(s);ve.current=s;const Te=lr(),Y=g.useRef(Te==null?void 0:Te.code);Y.current=Te==null?void 0:Te.code;const ce=["review","read","sourcingreview","orgreview"];g.useEffect(()=>{const w=Z.current;if(w){const A=Object.fromEntries(B.current.filter(I=>I.currentValue!==void 0&&I.currentValue!==null).map(I=>[I.code,I.currentValue]));Object.keys(A).length>0&&F(w,A)}ye.trigger().then(()=>{const A=ye.formState.errors,I=B.current,U=Array.from(new Set(Object.keys(A).map(z=>{var W;return(W=I.find(V=>V.code===z))==null?void 0:W.tab}).filter(Boolean)));be.current(Object.keys(A).length===0,U)})},[]),g.useEffect(()=>{const w=ye.watch((A,{name:I})=>{const U=Z.current;if(!U)return;const z=B.current,W=new Set(z.map(se=>se.code));if(I&&W.has(I)){let se=ye.getValues(I);if(I==="dialcodes"&&(se=Array.isArray(se)?se:se?[se]:[]),I==="shuffle"&&(se===!0&&me.current===!1&&Se(a.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Bn,{size:16})}),me.current=se),I==="framework"&&r&&typeof se=="string"&&se){const Ge=K.getState();if(Ge.setContentFramework(se,Ge.contentTargetFWIds),d){const st=re.getState().pruneCoursesByFramework(se);st>0&&Se(a.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(st)),{icon:l.jsx(Bn,{size:16}),duration:5e3});const Vt=re.getState().clearLevelSkills(Y.current);Vt>0&&Se(a.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(Vt)),{icon:l.jsx(Bn,{size:16}),duration:5e3})}}const je=MO(I,se);je&&(F(U,je),he.current(je))}else if(!I){const se=ye.getValues(),je=Object.fromEntries(Object.entries(se).filter(([st])=>W.has(st))),Ge=FO(je,{isReview:ce.includes(ve.current),nodeTitle:le.current});Object.keys(Ge).length>0&&(F(U,Ge),he.current(Ge))}const V=ye.formState.errors,ne=Array.from(new Set(Object.keys(V).map(se=>{var je;return(je=z.find(Ge=>Ge.code===se))==null?void 0:je.tab}).filter(Boolean)));be.current(Object.keys(V).length===0,ne)});return()=>w.unsubscribe()},[ye]),g.useEffect(()=>{for(const w of["author","creator","copyright","copyrightYear","license"]){const A=B.current.find(U=>U.code===w);if(!A||A.currentValue===void 0||A.currentValue===null||A.currentValue==="")continue;const I=ye.getValues(w);(I==null||I==="")&&ye.setValue(w,A.currentValue,{shouldDirty:!1})}},[T,D,ye]);const Q=we.reduce((w,A)=>{const I=w[w.length-1];return I&&I.section===A.section?I.fields.push(A):w.push({section:A.section,fields:[A]}),w},[]),Ce=w=>{const A={key:w.code,name:w.code,label:w.label,required:w.required,disabled:w.editable===!1};if(d&&w.code==="policy")return l.jsx("div",{className:jn.fullWidthField,children:l.jsx(Oj,{...A})},w.code);switch(w.inputType){case"textarea":return l.jsx(bd,{...A,multiline:!0,maxLength:w.maxLength});case"select":return l.jsx(EN,{...A,options:w.options??[]});case"multiselect":return l.jsx(AN,{...A,options:w.options??[]});case"chips":return l.jsx(kN,{...A});case"radio":return l.jsx(IN,{...A,options:w.options??[]});case"appIcon":return l.jsx(pj,{...A,nodeId:O??""});case"datepicker":case"datetime":return l.jsx(mj,{...A});case"keywords":case"tagsinput":return l.jsx(gj,{...A});case"nestedselect":return l.jsx(vj,{...A,levels:w.levels??[]});case"license":return l.jsx(yj,{...A});case"dialcode":return l.jsx(bj,{...A});default:return l.jsx(bd,{...A,maxLength:w.maxLength})}};return l.jsx(GL,{...ye,children:l.jsxs("div",{className:[jn.form,d?jn.formLp:""].filter(Boolean).join(" "),children:[Q.map((w,A)=>{const I=w.section?hO[w.section]:void 0;return I?l.jsx(QO,{title:I.title,description:I.description,children:w.fields.map(Ce)},w.section??A):l.jsx("div",{className:[jn.ungrouped,d?jn.ungroupedLp:""].filter(Boolean).join(" "),children:w.fields.map(Ce)},A)}),we.length===0&&!C&&l.jsx("p",{className:jn.noFields,children:a.sparkMetaForm.noFieldsMessage})]})})};function Kp(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function qj(e,t){return e.reduce((r,n,s)=>{const i=t.get(n);return i&&(r[s]=i),r},Array(e.length))}function _i(e){return e!==null&&e>=0}function $j(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function Uj(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Yp=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const i=Kp(t,n,r),o=t[s],a=i[s];return!a||!o?null:{x:a.left-o.left,y:a.top-o.top,scaleX:a.width/o.width,scaleY:a.height/o.height}},wi={scaleX:1,scaleY:1},zj=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:i,overIndex:o}=e;const a=(t=i[r])!=null?t:n;if(!a)return null;if(s===r){const u=i[o];return u?{x:0,y:r<o?u.top+u.height-(a.top+a.height):u.top-a.top,...wi}:null}const c=Vj(i,s,r);return s>r&&s<=o?{x:0,y:-a.height-c,...wi}:s<r&&s>=o?{x:0,y:a.height+c,...wi}:{x:0,y:0,...wi}};function Vj(e,t,r){const n=e[t],s=e[t-1],i=e[t+1];return n?r<t?s?n.top-(s.top+s.height):i?i.top-(n.top+n.height):0:i?i.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const Zp="Sortable",Xp=g.createContext({activeIndex:-1,containerId:Zp,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Yp,disabled:{draggable:!1,droppable:!1}});function Hj(e){let{children:t,id:r,items:n,strategy:s=Yp,disabled:i=!1}=e;const{active:o,dragOverlay:a,droppableRects:c,over:u,measureDroppableContainers:d}=jf(),f=Zs(Zp,r),m=a.rect!==null,p=g.useMemo(()=>n.map(E=>typeof E=="object"&&"id"in E?E.id:E),[n]),b=o!=null,h=o?p.indexOf(o.id):-1,v=u?p.indexOf(u.id):-1,y=g.useRef(p),C=!$j(p,y.current),S=v!==-1&&h===-1||C,_=Uj(i);ir(()=>{C&&b&&d(p)},[C,p,b,d]),g.useEffect(()=>{y.current=p},[p]);const x=g.useMemo(()=>({activeIndex:h,containerId:f,disabled:_,disableTransforms:S,items:p,overIndex:v,useDragOverlay:m,sortedRects:qj(p,c),strategy:s}),[h,f,_.draggable,_.droppable,S,p,v,c,m,s]);return g.createElement(Xp.Provider,{value:x},t)}const Qj=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return Kp(r,n,s).indexOf(t)},Wj=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:i,newIndex:o,previousItems:a,previousContainerId:c,transition:u}=e;return!u||!n||a!==i&&s===o?!1:r?!0:o!==s&&t===c},Gj={duration:200,easing:"ease"},Jp="transform",Kj=Vr.Transition.toString({property:Jp,duration:0,easing:"linear"}),Yj={roleDescription:"sortable"};function Zj(e){let{disabled:t,index:r,node:n,rect:s}=e;const[i,o]=g.useState(null),a=g.useRef(r);return ir(()=>{if(!t&&r!==a.current&&n.current){const c=s.current;if(c){const u=os(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}r!==a.current&&(a.current=r)},[t,r,n,s]),g.useEffect(()=>{i&&o(null)},[i]),i}function Xj(e){let{animateLayoutChanges:t=Wj,attributes:r,disabled:n,data:s,getNewIndex:i=Qj,id:o,strategy:a,resizeObserverConfig:c,transition:u=Gj}=e;const{items:d,containerId:f,activeIndex:m,disabled:p,disableTransforms:b,sortedRects:h,overIndex:v,useDragOverlay:y,strategy:C}=g.useContext(Xp),S=Jj(n,p),_=d.indexOf(o),x=g.useMemo(()=>({sortable:{containerId:f,index:_,items:d},...s}),[f,s,_,d]),E=g.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:D,node:T,isOver:j,setNodeRef:P}=ny({id:o,data:x,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...c}}),{active:O,activatorEvent:N,activeNodeRect:R,attributes:M,setNodeRef:$,listeners:ee,isDragging:H,over:te,setActivatorNodeRef:de,transform:fe}=Nf({id:o,data:x,attributes:{...Yj,...r},disabled:S.draggable}),pe=Ug(P,$),ae=!!O,we=ae&&!b&&_i(m)&&_i(v),ye=!y&&H,F=ye&&we?fe:null,Z=we?F??(a??C)({rects:h,activeNodeRect:R,activeIndex:m,overIndex:v,index:_}):null,he=_i(m)&&_i(v)?i({id:o,items:d,activeIndex:m,overIndex:v}):_,be=O==null?void 0:O.id,me=g.useRef({activeId:be,items:d,newIndex:he,containerId:f}),le=d!==me.current.items,ve=t({active:O,containerId:f,isDragging:H,isSorting:ae,id:o,index:_,items:d,newIndex:me.current.newIndex,previousItems:me.current.items,previousContainerId:me.current.containerId,transition:u,wasDragging:me.current.activeId!=null}),Te=Zj({disabled:!ve,index:_,node:T,rect:D});return g.useEffect(()=>{ae&&me.current.newIndex!==he&&(me.current.newIndex=he),f!==me.current.containerId&&(me.current.containerId=f),d!==me.current.items&&(me.current.items=d)},[ae,he,f,d]),g.useEffect(()=>{if(be===me.current.activeId)return;if(be&&!me.current.activeId){me.current.activeId=be;return}const ce=setTimeout(()=>{me.current.activeId=be},50);return()=>clearTimeout(ce)},[be]),{active:O,activeIndex:m,attributes:M,data:x,rect:D,index:_,newIndex:he,items:d,isOver:j,isSorting:ae,isDragging:H,listeners:ee,node:T,overIndex:v,over:te,setNodeRef:pe,setActivatorNodeRef:de,setDroppableNodeRef:P,setDraggableNodeRef:$,transform:Te??Z,transition:Y()};function Y(){if(Te||le&&me.current.newIndex===_)return Kj;if(!(ye&&!fo(N)||!u)&&(ae||ve))return Vr.Transition.toString({...u,property:Jp})}}function Jj(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function so(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const eP=[Oe.Down,Oe.Right,Oe.Up,Oe.Left],tP=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:i,over:o,scrollableAncestors:a}}=t;if(eP.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=s.get(f.id);if(m)switch(e.code){case Oe.Down:n.top<m.top&&c.push(f);break;case Oe.Up:n.top>m.top&&c.push(f);break;case Oe.Left:n.left>m.left&&c.push(f);break;case Oe.Right:n.left<m.left&&c.push(f);break}});const u=iv({collisionRect:n,droppableRects:s,droppableContainers:c});let d=gf(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=i.get(r.id),m=i.get(d),p=m?s.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&p&&f&&m){const v=ho(b).some((E,D)=>a[D]!==E),y=em(f,m),C=rP(f,m),S=v||!y?{x:0,y:0}:{x:C?n.width-p.width:0,y:C?n.height-p.height:0},_={x:p.left,y:p.top};return S.x&&S.y?_:Ps(_,S)}}}};function em(e,t){return!so(e)||!so(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function rP(e,t){return!so(e)||!so(t)||!em(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const nP="_row_1m6cn_1",sP="_removeBtn_1m6cn_14",iP="_grip_1m6cn_17",oP="_ctIcon_1m6cn_34",aP="_info_1m6cn_38",lP="_name_1m6cn_46",cP="_meta_1m6cn_55",Zr={row:nP,removeBtn:sP,grip:iP,ctIcon:oP,info:aP,name:lP,meta:cP},uP={video:_o,pdf:Js,h5p:yo,scorm:Co,audio:bo,quiz:vo,course:Qr,default:Wr},dP=({item:e,onRemove:t,isEditable:r})=>{const n=oe(),s=oi(e),i=uP[s.key]??Wr,{attributes:o,listeners:a,setNodeRef:c,transform:u,transition:d,isDragging:f}=Xj({id:e.id,disabled:!r}),m={transform:Vr.Transform.toString(u),transition:d,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:m,className:Zr.row,role:"listitem",children:[r&&l.jsx("span",{className:Zr.grip,...o,...a,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(qf,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,Zr.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Zr.info,children:[l.jsx("span",{className:Zr.name,title:e.name,children:e.name}),l.jsx("span",{className:Zr.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:Zr.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(br,{size:14})})]})},fP="_container_pi4q5_1",hP="_header_pi4q5_7",pP="_heading_pi4q5_13",mP="_count_pi4q5_21",gP="_list_pi4q5_30",vP="_emptyState_pi4q5_36",yP="_skillPicker_pi4q5_52",bP="_skillsCovered_pi4q5_52",CP="_chips_pi4q5_64",SP="_chip_pi4q5_64",_P="_skillWarning_pi4q5_80",wP="_selectedSkills_pi4q5_85",xP="_skillPill_pi4q5_91",TP="_skillPillFlagged_pi4q5_103",EP="_skillPillUncovered_pi4q5_107",AP="_skillPillRemove_pi4q5_112",kP="_skillSearchBox_pi4q5_127",IP="_skillSearchWrap_pi4q5_132",DP="_searchIcon_pi4q5_147",LP="_skillSearchInput_pi4q5_152",OP="_skillDropdown_pi4q5_165",NP="_skillOption_pi4q5_179",jP="_skillCheckbox_pi4q5_201",PP="_skillCheckboxChecked_pi4q5_213",RP="_skillDropdownEmpty_pi4q5_218",FP="_skillPickerNote_pi4q5_224",MP="_emptyHint_pi4q5_229",BP="_assessmentsCard_pi4q5_242",qP="_assessmentSlots_pi4q5_254",$P="_assessmentItemRow_pi4q5_260",UP="_assessmentItemIcon_pi4q5_271",zP="_assessmentItemInfo_pi4q5_283",VP="_assessmentItemTitle_pi4q5_290",HP="_assessmentItemMeta_pi4q5_299",QP="_addRowIcon_pi4q5_304",WP="_assessmentItemBadge_pi4q5_316",GP="_menuWrap_pi4q5_327",KP="_menuBtn_pi4q5_332",YP="_dropmenu_pi4q5_345",ZP="_dangerItem_pi4q5_375",XP="_addRow_pi4q5_304",JP="_addRowAssessment_pi4q5_399",eR="_addRowText_pi4q5_406",tR="_requiredBadge_pi4q5_411",ue={container:fP,header:hP,heading:pP,count:mP,list:gP,emptyState:vP,skillPicker:yP,skillsCovered:bP,chips:CP,chip:SP,skillWarning:_P,selectedSkills:wP,skillPill:xP,skillPillFlagged:TP,skillPillUncovered:EP,skillPillRemove:AP,skillSearchBox:kP,skillSearchWrap:IP,searchIcon:DP,skillSearchInput:LP,skillDropdown:OP,skillOption:NP,skillCheckbox:jP,skillCheckboxChecked:PP,skillDropdownEmpty:RP,skillPickerNote:FP,emptyHint:MP,assessmentsCard:BP,assessmentSlots:qP,assessmentItemRow:$P,assessmentItemIcon:UP,assessmentItemInfo:zP,assessmentItemTitle:VP,assessmentItemMeta:HP,addRowIcon:QP,assessmentItemBadge:WP,menuWrap:GP,menuBtn:KP,dropmenu:YP,dangerItem:ZP,addRow:XP,addRowAssessment:JP,addRowText:eR,requiredBadge:tR},rR=({options:e,selected:t,outOfScope:r,uncovered:n,onChange:s,isEditable:i,description:o})=>{const a=oe(),[c,u]=g.useState(""),[d,f]=g.useState(!1),m=g.useRef(null);g.useEffect(()=>{if(!d)return;const v=y=>{var C;(C=m.current)!=null&&C.contains(y.target)||f(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const p=c?e.filter(v=>v.toLowerCase().includes(c.toLowerCase())):e,b=v=>{i&&s(t.includes(v)?t.filter(y=>y!==v):[...t,v])},h=v=>{i&&s(t.filter(y=>y!==v))};return l.jsxs("div",{className:ue.skillPicker,children:[l.jsxs("div",{className:ue.header,children:[l.jsx("span",{className:ue.heading,children:a.learningPath.skillsHeading}),l.jsx("span",{className:ue.count,children:t.length})]}),l.jsx("span",{className:ue.skillPickerNote,children:o}),r.length>0&&l.jsx("div",{className:ue.skillWarning,role:"alert",children:a.learningPath.skillsOutOfScopeWarning.replace("{skills}",r.join(", "))}),n.length>0&&l.jsx("div",{className:ue.skillWarning,role:"alert",children:a.learningPath.skillsUncoveredWarning.replace("{skills}",n.join(", "))}),t.length>0&&l.jsx("div",{className:ue.selectedSkills,children:t.map(v=>{const y=r.includes(v),C=n.includes(v);return l.jsxs("span",{className:[ue.skillPill,y?ue.skillPillFlagged:"",C?ue.skillPillUncovered:""].filter(Boolean).join(" "),title:C?a.learningPath.skillUncoveredPillTitle:void 0,children:[v,i&&l.jsx("button",{type:"button",className:ue.skillPillRemove,onClick:()=>h(v),"aria-label":a.learningPath.removeSkillAriaLabel.replace("{skill}",v),children:l.jsx(br,{size:11})})]},v)})}),i?l.jsxs("div",{className:ue.skillSearchBox,ref:m,children:[l.jsxs("div",{className:ue.skillSearchWrap,onClick:()=>f(!0),children:[l.jsx("input",{type:"search",className:ue.skillSearchInput,placeholder:a.learningPath.searchSkillsPlaceholder,value:c,onChange:v=>u(v.target.value),onFocus:()=>f(!0),"aria-label":a.learningPath.searchSkillsPlaceholder}),l.jsx(Yi,{size:14,className:ue.searchIcon})]}),d&&l.jsx("div",{className:ue.skillDropdown,role:"listbox",children:e.length===0?l.jsx("div",{className:ue.skillDropdownEmpty,children:a.learningPath.noSkillsAvailable}):p.length===0?l.jsx("div",{className:ue.skillDropdownEmpty,children:a.learningPath.noMatchingSkills}):p.map(v=>{const y=t.includes(v);return l.jsxs("button",{type:"button",role:"option","aria-selected":y,className:ue.skillOption,onClick:()=>b(v),children:[l.jsx("span",{className:[ue.skillCheckbox,y?ue.skillCheckboxChecked:""].join(" "),children:y&&l.jsx(bn,{size:12})}),v]},v)})})]}):t.length===0&&l.jsx("span",{className:ue.emptyHint,children:a.learningPath.noSkillsSelectedYet})]})},dl=({slot:e,isEditable:t})=>{const r=oe(),{pre:n,post:s,setActiveAssessmentSlot:i,deleteSlot:o}=Ql(),a=re(h=>h.selectNode),[c,u]=g.useState(!1),d=g.useRef(null),f=e==="pre"?n:s,m=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(g.useEffect(()=>{if(!c)return;const h=v=>{var y;(y=d.current)!=null&&y.contains(v.target)||u(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[c]),!f.filled)return l.jsxs("button",{type:"button",className:[ue.addRow,ue.addRowAssessment].join(" "),disabled:!t,onClick:()=>i(e),children:[l.jsx("span",{className:ue.addRowIcon,children:l.jsx(Sn,{size:16})}),l.jsx("span",{className:ue.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",m)}),f.required&&l.jsx("span",{className:ue.requiredBadge,children:r.learningPath.requiredSlotBadge})]});const p=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,b=()=>f.level&&a(f.level.id);return l.jsxs("div",{className:ue.assessmentItemRow,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),b())},children:[l.jsx("span",{className:ue.assessmentItemIcon,children:l.jsx(Qr,{size:16})}),l.jsxs("div",{className:ue.assessmentItemInfo,children:[l.jsx("span",{className:ue.assessmentItemTitle,children:f.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:ue.assessmentItemMeta,children:[m," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:ue.assessmentItemBadge,children:p}),t&&l.jsxs("div",{className:ue.menuWrap,ref:d,children:[l.jsx("button",{type:"button",className:ue.menuBtn,onClick:h=>{h.stopPropagation(),u(v=>!v)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),c&&l.jsxs("div",{className:ue.dropmenu,onClick:h=>h.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{u(!1),f.level&&a(f.level.id)},children:[l.jsx(ky,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:ue.dangerItem,onClick:()=>{u(!1),o(e)},children:[l.jsx(So,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})},nR=({editorMode:e,isRoot:t=!1})=>{const r=oe(),{selectedNodeId:n,getChildrenOf:s,getNodeById:i,reorderChildren:o,deleteNode:a,activeNodeMeta:c,updateNode:u,treeData:d}=re(),f=K(R=>R.editorProfile),m=n?s(n):[],p=e==="edit",b=n?i(n):void 0,h=f.competencyScoped,v=h&&!t&&!lt(b),y=h&&t,{scope:C,source:S}=ii(),_=lr(),x=_&&Array.isArray(c[_.code])?c[_.code]:[],E=S==="prior"?x.filter(R=>!C.includes(R)):[],D=y?Eh(d[0],_==null?void 0:_.code):[],T=v?Ah(b,x,_==null?void 0:_.code):[],j=g.useCallback(R=>{!n||!(_!=null&&_.code)||u(n,{[_.code]:R},[_.code])},[n,_==null?void 0:_.code,u]),P=hf(ja(po,{activationConstraint:{distance:5}}),ja(Cl,{coordinateGetter:tP})),O=g.useCallback(R=>{const{active:M,over:$}=R;if(!$||M.id===$.id||!n)return;const ee=re.getState().getChildrenOf(n),H=ee.findIndex(de=>de.id===M.id),te=ee.findIndex(de=>de.id===$.id);H<0||te<0||o(n,H,te)},[n,o]),N=g.useCallback(R=>{window.confirm(r.unitContentList.removeConfirm)&&a(R)},[a,r.unitContentList.removeConfirm]);return n?l.jsxs("div",{className:ue.container,children:[y&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ue.skillsCovered,children:[l.jsx("span",{className:ue.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:ue.emptyHint,children:r.learningPath.skillsCoveredDescription}),D.length>0&&l.jsx("div",{className:ue.chips,children:D.map(R=>l.jsx("span",{className:ue.chip,children:R},R))}),D.length===0&&l.jsx("span",{className:ue.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:ue.assessmentsCard,children:[l.jsx("span",{className:ue.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:ue.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:ue.assessmentSlots,children:[l.jsx(dl,{slot:"pre",isEditable:p}),l.jsx(dl,{slot:"post",isEditable:p})]})]})]}),v&&l.jsx(rR,{options:C,selected:x,outOfScope:E,uncovered:T,onChange:j,isEditable:p,description:S==="prior"?r.learningPath.skillScopeFromPriorNote:r.learningPath.skillScopeManualNote}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ue.header,children:[l.jsx("span",{className:ue.heading,children:r.unitContentList.heading}),l.jsx("span",{className:ue.count,children:m.length})]}),m.length>0?l.jsx(Of,{sensors:P,collisionDetection:sv,onDragEnd:O,children:l.jsx(Hj,{items:m.map(R=>R.id),strategy:zj,children:l.jsx("div",{className:ue.list,role:"list",children:m.map(R=>l.jsx(dP,{item:R,onRemove:N,isEditable:p},R.id))})})}):l.jsxs("div",{className:ue.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),p&&!lt(b)&&l.jsxs("button",{className:ue.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Sn,{size:14})," ",r.unitContentList.addContent]})]})]}):null},sR="_dropZone_ijo5w_1",iR="_active_ijo5w_14",_d={dropZone:sR,active:iR},oR=({isActive:e,label:t,nodeId:r,className:n})=>{const s=oe(),i=t??s.dropZone.dropHere;return l.jsx("div",{className:`${_d.dropZone} ${e?_d.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":i,role:"region",children:l.jsx("span",{children:i})})},tm=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function aR(e){var o;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((o=(await Fe.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??tm}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:o.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([a])=>!s.has(a)).flatMap(([,a])=>Array.isArray(a)?a:[]),count:n.count??0}}async function wd(e,t){var s,i;const r=t!=null&&t.length?`?fields=${t.join(",")}`:"";return(i=(s=(await Fe.get(`/action/content/v3/read/${e}${r}`)).data)==null?void 0:s.result)==null?void 0:i.content}const xd="application/vnd.sunbird.question";function Td(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function rm(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=rm(n,t,e);if(s)return s}return null}function lR(e,t){const r=rm(e,t);if(!r)return null;const{question:n,parent:s}=r,i={...e,children:[n],childNodes:[t],shuffle:s==null?void 0:s.shuffle,showSolutions:(s==null?void 0:s.showSolutions)??"No",showFeedback:(s==null?void 0:s.showFeedback)??"No"};return(s==null?void 0:s.shuffle)===!0?i.maxScore=1:n.qType==="SA"?delete i.maxScore:n.maxScore!=null&&(i.maxScore=n.maxScore),i}function cR(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return Jn({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await yh(e),s=d=>{if(!d)return[];const f=d.mimeType===xd&&d.identifier?[d.identifier]:[],m=(d.children??[]).flatMap(s);return[...f,...m]},i=s(n),o=new Map;i.length&&(await t0(i)).forEach(f=>{const m=f.identifier;m&&o.set(m,f)});const a=d=>{if(!d)return d;if(d.mimeType===xd&&d.identifier){const f=o.get(d.identifier)??d,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:Td(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>a(f))),d},c=a(n),u=c.outcomeDeclaration;return u!=null&&u.maxScore||(c.outcomeDeclaration={...u??{},maxScore:Td(c)}),c}})}const Ed="/assets/quml-player/sunbird-quml-player.js",uR="/assets/quml-player/styles.css",Ad="sunbird-quml-player";function dR(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const ut=class ut{constructor(){ps(this,"eventHandlers",new WeakMap)}loadScript(){return ut.scriptLoaded||customElements.get(Ad)?(ut.scriptLoaded=!0,Promise.resolve()):(ut.scriptLoading||(ut.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=Ed,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{ut.scriptLoaded=!0,ut.scriptLoading=void 0,t()},n.onerror=()=>{ut.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${Ed}`))},document.body.appendChild(n)})),ut.scriptLoading)}loadStyles(){if(ut.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){ut.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=uR,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),ut.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),ut.stylesLoaded=!1}async createConfig(t,r,n){var i,o,a;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((i=r==null?void 0:r.pdata)==null?void 0:i.id)??"sunbird.portal",ver:((o=r==null?void 0:r.pdata)==null?void 0:o.ver)??"1.0",pid:((a=r==null?void 0:r.pdata)==null?void 0:a.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:dR(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(Ad);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const s=o=>r==null?void 0:r(o),i=o=>n==null?void 0:n(o.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",i),this.eventHandlers.set(t,{player:s,telemetry:i})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};ps(ut,"scriptLoaded",!1),ps(ut,"scriptLoading"),ps(ut,"stylesLoaded",!1);let io=ut;const xi=new io,fR="_contentPlayerRoot_1rdfn_1",hR="_flowLayout_1rdfn_9",pR="_stage_1rdfn_13",mR="_aspectRatio_1rdfn_16",gR="_playerHeader_1rdfn_32",vR="_playerHeaderThumb_1rdfn_46",yR="_playerHeaderTitle_1rdfn_56",bR="_typeBadge_1rdfn_66",CR="_typeDot_1rdfn_105",SR="_playerFrame_1rdfn_125",_R="_coverOverlay_1rdfn_133",wR="_coverHidden_1rdfn_145",xR="_coverThumb_1rdfn_150",TR="_coverPlayRing_1rdfn_159",ER="_coverPlayIcon_1rdfn_172",AR="_coverLabel_1rdfn_181",kR="_coverSkeleton_1rdfn_187",IR="_playerWrapper_1rdfn_213",DR="_infoStrip_1rdfn_223",LR="_infoChip_1rdfn_239",OR="_infoChipLabel_1rdfn_258",NR="_infoChipIcon_1rdfn_267",jR="_playerError_1rdfn_273",PR="_playerErrorIcon_1rdfn_287",RR="_playerErrorMsg_1rdfn_292",FR="_qumlRoot_1rdfn_299",He={contentPlayerRoot:fR,flowLayout:hR,stage:pR,aspectRatio:mR,playerHeader:gR,playerHeaderThumb:vR,playerHeaderTitle:yR,typeBadge:bR,typeDot:CR,playerFrame:SR,coverOverlay:_R,coverHidden:wR,coverThumb:xR,coverPlayRing:TR,coverPlayIcon:ER,coverLabel:AR,coverSkeleton:kR,playerWrapper:IR,infoStrip:DR,infoChip:LR,infoChipLabel:OR,infoChipIcon:NR,playerError:jR,playerErrorIcon:PR,playerErrorMsg:RR,qumlRoot:FR},MR="application/vnd.sunbird.questionset",BR="application/vnd.ekstep.ecml-archive";function qR(e,t){const r=new Map,n=i=>{for(const o of i)r.set(o.id,o),o.children&&n(o.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===MR)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const $R=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function UR(e){return $R.find(t=>t.mimes.includes(e))??{key:"other"}}function zR(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const VR={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},HR={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},QR={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},WR="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function ma(e){for(const[t,r]of Object.entries(VR))if(r.includes(e))return t;return"default-player"}function GR(e,t,r){var i;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((i=n==null?void 0:n.pdata)==null?void 0:i.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/content-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:s==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function KR(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function YR(e,t,r=100){await KR(HR[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let i=0;const o=setInterval(()=>{i++,customElements.get(e)?(clearInterval(o),n()):i>=r&&(clearInterval(o),s(new Error(`Custom element <${e}> did not register`)))},100)})}const ZR=[{key:"author",icon:Wy},{key:"license",icon:By},{key:"language",icon:Dy},{key:"gradeLevel",icon:qy},{key:"subject",icon:Qr},{key:"contentType",icon:Hy}];function XR(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function JR({node:e}){const t=oe(),r=e.metadata??{},n=ZR.flatMap(s=>{const i=r[s.key];if(!i)return[];const o=Array.isArray(i)?i.join(", "):String(i);return o?[{...s,label:XR(s.key,t),val:o}]:[]});return n.length?l.jsx("div",{className:He.infoStrip,children:n.map(s=>l.jsxs("div",{className:He.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:He.infoChipIcon}),l.jsx("span",{className:He.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function nm({node:e,hidden:t}){var s;const r=oe(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsx("div",{className:`${He.coverOverlay} ${t?He.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:He.coverThumb}),l.jsx("div",{className:He.coverPlayRing,children:l.jsx("div",{className:He.coverPlayIcon})}),l.jsx("span",{className:He.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:He.coverSkeleton})})}function sm({message:e}){return l.jsxs("div",{className:He.playerError,children:[l.jsx(Qy,{size:28,className:He.playerErrorIcon}),l.jsx("span",{className:He.playerErrorMsg,children:e})]})}function eF({mimeType:e}){const t=oe(),r=UR(e);return l.jsxs("span",{className:He.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:He.typeDot}),zR(r.key,t)]})}const fl=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var o;if(r==="quml")return l.jsx(rF,{node:e,editorMode:t,singleQuestion:!!n});const i=e.appIcon??((o=e.metadata)==null?void 0:o.appIcon);return l.jsxs("div",{className:`${He.contentPlayerRoot} ${s==="flow"?He.flowLayout:""}`,children:[l.jsxs("div",{className:He.stage,children:[l.jsxs("div",{className:He.playerHeader,children:[i&&l.jsx("img",{src:i,alt:"",className:He.playerHeaderThumb}),l.jsx("span",{className:He.playerHeaderTitle,children:e.name}),l.jsx(eF,{mimeType:e.mimeType??""})]}),l.jsx(tF,{node:e})]}),l.jsx(JR,{node:e})]})};function tF({node:e}){var y;const t=oe(),r=K(C=>C.editorConfig),[n,s]=g.useState(()=>ma(e.mimeType??"")),[i,o]=g.useState(!1),[a,c]=g.useState(null),[u,d]=g.useState(e.metadata??{}),[f,m]=g.useState(!1),p=g.useRef(null),b=g.useRef(null),h=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??WR;g.useEffect(()=>{let C=!1;return m(!1),o(!1),c(null),d(e.metadata??{}),s(ma(e.mimeType??"")),wd(e.identifier).then(async S=>{if((S.mimeType??e.mimeType??"")!==BR||S.body)return S;const x=await wd(e.identifier,["body"]).catch(()=>{});return x!=null&&x.body?{...S,body:x.body}:S}).then(S=>{if(C)return;const _={...e.metadata??{},...S};d(_);const x=S.mimeType??e.mimeType??"";s(ma(x)),m(!0)}).catch(()=>{C||m(!0)}),()=>{C=!0}},[e.identifier]);const v=GR(e,u,r);return g.useEffect(()=>{if(!f||n!=="default-player")return;const C=p.current;if(!C)return;C.src=h;const S=()=>{try{const x=C.contentWindow;if(typeof(x==null?void 0:x.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}x.initializePreview(v),setTimeout(()=>o(!0),300)}catch(x){console.error("[ContentPlayer] initializePreview failed",x),c(t.contentPlayer.failedToInitializePlayer)}},_=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",_),()=>{C.removeEventListener("load",S),C.removeEventListener("error",_),C.src=""}},[e.identifier,n,h,f,t]),g.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=QR[n];if(!S)return;const _=v;YR(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){s("default-player");return}const x=document.createElement(S);x.setAttribute("player-config",JSON.stringify(_)),x.addEventListener("playerEvent",()=>{}),x.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(x),setTimeout(()=>{try{x.playerConfig=_}catch{}o(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:He.aspectRatio,children:[a?l.jsx(sm,{message:a}):l.jsx(nm,{node:e,hidden:i}),n==="default-player"?l.jsx("iframe",{ref:p,id:"contentPlayer",title:e.name,className:He.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:He.playerFrame})]})}function rF({node:e,editorMode:t,singleQuestion:r}){const n=oe(),s=K(p=>p.editorConfig),i=re(p=>p.treeData),o=g.useRef(null),a=r?qR(i,e.id):e.identifier,{data:c,isLoading:u,error:d}=cR(a??"",{enabled:!!a}),f=g.useMemo(()=>c?r?lR(c,e.identifier):c:null,[c,r,e.identifier]);g.useEffect(()=>{const p=o.current;if(!p||!f)return;let b=null,h=!1;return(async()=>{try{const v=await xi.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(h||!o.current)return;const y=xi.createElement(v);b=y,xi.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),p.innerHTML="",p.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{h=!0,b&&(xi.removeEventListeners(b),b.remove()),io.unloadStyles()}},[f,s,t,r]);const m=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!a?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:He.qumlRoot,children:[m?l.jsx(sm,{message:m}):u||!f?l.jsx(nm,{node:e,hidden:!1}):null,l.jsx("div",{ref:o,className:He.playerWrapper})]})}const nF="_overlay_1b1xq_1",sF="_modal_1b1xq_11",iF="_header_1b1xq_21",oF="_body_1b1xq_37",aF="_hint_1b1xq_43",lF="_list_1b1xq_49",cF="_item_1b1xq_55",uF="_selected_1b1xq_68",dF="_empty_1b1xq_73",fF="_footer_1b1xq_79",hF="_cancelBtn_1b1xq_87",pF="_moveBtn_1b1xq_95",Gt={overlay:nF,modal:sF,header:iF,body:oF,hint:aF,list:lF,item:cF,selected:uF,empty:dF,footer:fF,cancelBtn:hF,moveBtn:pF};function mF(e,t,r){const n=[],s=i=>{var o;for(const a of i)a.isFolder&&a.id!==r&&a.id!==t&&n.push(a),(o=a.children)!=null&&o.length&&s(a.children)};return s(e),n}const gF=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=oe(),{treeData:i,moveNode:o}=re(),a=mF(i,((f=i[0])==null?void 0:f.id)??"",r),[c,u]=g.useState(null),d=()=>{c&&(o(e,r,c),n())};return l.jsx("div",{className:Gt.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:Gt.modal,children:[l.jsxs("div",{className:Gt.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(br,{size:16})})]}),l.jsxs("div",{className:Gt.body,children:[l.jsx("p",{className:Gt.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:Gt.list,children:[a.map(m=>l.jsxs("li",{className:`${Gt.item} ${c===m.id?Gt.selected:""}`,onClick:()=>u(m.id),children:[l.jsx(Iy,{size:14}),l.jsx("span",{children:m.name})]},m.id)),a.length===0&&l.jsx("li",{className:Gt.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:Gt.footer,children:[l.jsx("button",{className:Gt.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:Gt.moveBtn,onClick:d,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},vF="_overlay_1d56g_1",yF="_modal_1d56g_11",bF="_header_1d56g_21",CF="_body_1d56g_37",SF="_table_1d56g_43",_F="_pageInput_1d56g_61",wF="_empty_1d56g_68",xF="_footer_1d56g_74",TF="_cancelBtn_1d56g_82",EF="_saveBtn_1d56g_90",fr={overlay:vF,modal:yF,header:bF,body:CF,table:SF,pageInput:_F,empty:wF,footer:xF,cancelBtn:TF,saveBtn:EF};function AF(e){const t=[],r=n=>{var s;for(const i of n)!i.isFolder&&(!i.children||i.children.length===0)?t.push(i):(s=i.children)!=null&&s.length&&r(i.children)};return r(e),t}const kF=({onClose:e})=>{const t=oe(),{treeData:r,updateNode:n}=re(),s=AF(r),[i,o]=g.useState(()=>Object.fromEntries(s.map(c=>{var u;return[c.id,String(((u=c.metadata)==null?void 0:u.pageNumber)??"")]}))),a=g.useCallback(()=>{for(const[c,u]of Object.entries(i))u!==""&&n(c,{pageNumber:parseInt(u,10)||void 0});e()},[i,n,e]);return l.jsx("div",{className:fr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:fr.modal,children:[l.jsxs("div",{className:fr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(br,{size:16})})]}),l.jsx("div",{className:fr.body,children:s.length===0?l.jsx("p",{className:fr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:fr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:s.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:i[c.id]??"",onChange:u=>o(d=>({...d,[c.id]:u.target.value})),className:fr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:fr.footer,children:[l.jsx("button",{className:fr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:fr.saveBtn,onClick:a,children:[l.jsx(My,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},IF="_container_p2feh_1",DF="_panelHeader_p2feh_10",LF="_panelHeaderLeft_p2feh_19",OF="_panelCollapseBtn_p2feh_27",NF="_titleRow_p2feh_46",jF="_field_p2feh_47",PF="_moveBtn_p2feh_64",RF="_icon_p2feh_84",FF="_nameInput_p2feh_93",MF="_fieldHeader_p2feh_118",BF="_label_p2feh_124",qF="_fieldCount_p2feh_133",$F="_chips_p2feh_170",UF="_chip_p2feh_170",zF="_chipRemove_p2feh_188",VF="_keywordInput_p2feh_202",HF="_input_p2feh_207",QF="_addBtn_p2feh_220",WF="_radioGroup_p2feh_234",GF="_radioLabel_p2feh_239",Ke={container:IF,panelHeader:DF,panelHeaderLeft:LF,panelCollapseBtn:OF,titleRow:NF,field:jF,moveBtn:PF,icon:RF,nameInput:FF,fieldHeader:MF,label:BF,fieldCount:qF,chips:$F,chip:UF,chipRemove:zF,keywordInput:VF,input:HF,addBtn:QF,radioGroup:WF,radioLabel:GF},KF=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var N,R;const{updateNode:s,markDirty:i}=re(),o=t==="edit",a=oi(e),c=oe(),u=K(M=>M.relationalFormConfig),d=M=>u==null?void 0:u.find($=>$.code===M),f=M=>!u||!!d(M),m=(M,$)=>{var ee;return((ee=d(M))==null?void 0:ee.label)||$},[p,b]=g.useState(!0),h=((N=e.metadata)==null?void 0:N.relationalMetadata)??{},[v,y]=g.useState(h.name??e.name??""),[C,S]=g.useState(""),[_,x]=g.useState(Array.isArray(h.keywords)?h.keywords:Array.isArray((R=e.metadata)==null?void 0:R.keywords)?e.metadata.keywords:[]),[E,D]=g.useState(!!h.optional);g.useEffect(()=>{var $,ee;const M=(($=e.metadata)==null?void 0:$.relationalMetadata)??{};y(M.name??e.name??""),x(Array.isArray(M.keywords)?M.keywords:Array.isArray((ee=e.metadata)==null?void 0:ee.keywords)?e.metadata.keywords:[]),D(!!M.optional)},[e.id]);const T=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),i())},j=()=>{const M=C.trim();if(M&&!_.includes(M)){const $=[..._,M];x($),s(e.id,{keywords:$}),i()}S("")},P=M=>{const $=_.filter(ee=>ee!==M);x($),s(e.id,{keywords:$}),i()},O=M=>{D(M),s(e.id,{optional:M}),i()};return l.jsxs("div",{className:Ke.container,children:[l.jsxs("div",{className:Ke.panelHeader,children:[l.jsxs("div",{className:Ke.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${a.key}`,children:a.label}),o&&l.jsx("button",{type:"button",className:Ke.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:Ke.panelCollapseBtn,onClick:()=>b(M=>!M),"aria-expanded":p,"aria-label":p?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:p?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:p?l.jsx(Cn,{size:15}):l.jsx(xy,{size:15})})]}),p&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Ke.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:Ke.icon}),l.jsx("input",{type:"text",className:Ke.nameInput,value:v,disabled:!o,onChange:M=>y(M.target.value),onBlur:T,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:Ke.field,children:[l.jsx("div",{className:Ke.fieldHeader,children:l.jsxs("label",{className:Ke.label,children:[m("keywords",c.contentEditForm.keywordsLabel),_.length>0&&l.jsx("span",{className:Ke.fieldCount,children:_.length})]})}),_.length>0&&l.jsx("div",{className:Ke.chips,children:_.map(M=>l.jsxs("span",{className:Ke.chip,children:[M,o&&l.jsx("button",{type:"button",className:Ke.chipRemove,onClick:()=>P(M),children:"×"})]},M))}),o&&l.jsxs("div",{className:Ke.keywordInput,children:[l.jsx("input",{type:"text",className:Ke.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:M=>S(M.target.value),onKeyDown:M=>{M.key==="Enter"&&(M.preventDefault(),j())}}),l.jsx("button",{type:"button",className:Ke.addBtn,onClick:j,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:Ke.field,children:[l.jsx("label",{className:Ke.label,children:m("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:Ke.radioGroup,children:[l.jsxs("label",{className:Ke.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!0,onChange:()=>O(!0),disabled:!o}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:Ke.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:E===!1,onChange:()=>O(!1),disabled:!o}),c.contentEditForm.noOption]})]})]})]}),n]})},YF="_iconBtn_gliz0_1",ZF="_editable_gliz0_14",XF="_iconImg_gliz0_26",JF="_placeholder_gliz0_34",e2="_removeBtn_gliz0_41",_s={iconBtn:YF,editable:ZF,iconImg:XF,placeholder:JF,removeBtn:e2},t2=({nodeId:e,value:t,editable:r})=>{const[n,s]=g.useState(!1),{updateNode:i,markDirty:o}=re(),a=oe(),c=d=>{i(e,{appIcon:d}),o(),s(!1)},u=d=>{d.stopPropagation(),i(e,{appIcon:""}),o()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[_s.iconBtn,r?_s.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?a.titleAppIcon.selectAppIconAriaLabel:a.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:a.titleAppIcon.appIconAlt,className:_s.iconImg}):l.jsx("div",{className:_s.placeholder,children:l.jsx($f,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:_s.removeBtn,onClick:u,"aria-label":a.titleAppIcon.removeIconAriaLabel,children:l.jsx(So,{size:11})})]}),n&&l.jsx(Gp,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},r2="_courseDetails_1eby7_1",n2="_courseDetailsLoading_1eby7_7",s2="_courseDetailsError_1eby7_7",i2="_detailsCard_1eby7_12",o2="_unitsCard_1eby7_12",a2="_cardTitle_1eby7_22",l2="_fieldGroup_1eby7_29",c2="_fieldGroupLast_1eby7_33",u2="_fieldLabel_1eby7_37",d2="_fieldValue_1eby7_47",f2="_fieldValueMultiline_1eby7_52",h2="_unitsLabel_1eby7_58",p2="_unitsDescription_1eby7_68",m2="_unitList_1eby7_74",g2="_unitCard_1eby7_80",v2="_unitHeader_1eby7_86",y2="_unitIcon_1eby7_99",b2="_unitTitle_1eby7_111",C2="_unitCount_1eby7_120",S2="_unitBody_1eby7_126",_2="_unitDescription_1eby7_131",w2="_unitKeywords_1eby7_138",x2="_keywordPill_1eby7_145",T2="_unitTopicsRow_1eby7_155",E2="_unitContents_1eby7_167",A2="_contentRow_1eby7_174",k2="_contentIcon_1eby7_180",I2="_contentTitle_1eby7_185",D2="_contentSkills_1eby7_193",L2="_skillPill_1eby7_200",Ne={courseDetails:r2,courseDetailsLoading:n2,courseDetailsError:s2,detailsCard:i2,unitsCard:o2,cardTitle:a2,fieldGroup:l2,fieldGroupLast:c2,fieldLabel:u2,fieldValue:d2,fieldValueMultiline:f2,unitsLabel:h2,unitsDescription:p2,unitList:m2,unitCard:g2,unitHeader:v2,unitIcon:y2,unitTitle:b2,unitCount:C2,unitBody:S2,unitDescription:_2,unitKeywords:w2,keywordPill:x2,unitTopicsRow:T2,unitContents:E2,contentRow:A2,contentIcon:k2,contentTitle:I2,contentSkills:D2,skillPill:L2},O2={video:_o,pdf:Js,h5p:yo,scorm:Co,audio:bo,quiz:vo,course:Qr,default:Wr};function ga(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const im=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=oe(),i=lr(),[o,a]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(null),[m,p]=g.useState({}),b=t==="full";g.useEffect(()=>{let C=!1;return a(null),u(""),f(null),Ch(e).then(S=>{if(C)return;const x=(S.children??[]).map(E=>Eo(E));a(x),u(S.description??""),p(Object.fromEntries(x.map(E=>[E.id,!0]))),n==null||n({totalContents:x.reduce((E,D)=>{var T;return E+(((T=D.children)==null?void 0:T.length)??0)},0)})}).catch(()=>{C||f(s.learningPath.courseDetailsError)}),()=>{C=!0}},[e,s.learningPath.courseDetailsError]);const h=C=>p(S=>({...S,[C]:!S[C]})),v=C=>{var S;return i?ga((S=C.metadata)==null?void 0:S[i.code]):[]},y=C=>(C===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:Ne.courseDetails,children:d?l.jsx("p",{className:Ne.courseDetailsError,children:d}):o===null?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:Ne.detailsCard,children:[l.jsx("h3",{className:Ne.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:Ne.fieldGroup,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:Ne.fieldValue,children:r})]}),l.jsxs("div",{className:Ne.fieldGroupLast,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:Ne.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),o.length===0?l.jsx("p",{className:Ne.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?Ne.unitsCard:void 0,children:[l.jsx("span",{className:Ne.unitsLabel,children:s.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:Ne.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:Ne.unitList,children:o.map(C=>{var D,T;const S=!!m[C.id],_=(C.children??[]).length,x=ga((D=C.metadata)==null?void 0:D.keywords),E=ga((T=C.metadata)==null?void 0:T.topic);return l.jsxs("div",{className:Ne.unitCard,children:[l.jsxs("button",{type:"button",className:Ne.unitHeader,onClick:()=>h(C.id),"aria-expanded":S,children:[S?l.jsx(Cn,{size:17}):l.jsx(xl,{size:17}),l.jsx("span",{className:Ne.unitIcon,children:l.jsx(Bf,{size:16})}),l.jsx("span",{className:Ne.unitTitle,children:C.name}),b&&l.jsx("span",{className:Ne.unitCount,children:y(_)})]}),S&&l.jsxs("div",{className:Ne.unitBody,children:[b&&C.description&&l.jsx("p",{className:Ne.unitDescription,children:C.description}),b&&x.length>0&&l.jsx("div",{className:Ne.unitKeywords,children:x.map(j=>l.jsx("span",{className:Ne.keywordPill,children:j},j))}),b&&E.length>0&&l.jsxs("div",{className:Ne.unitTopicsRow,children:[l.jsx("span",{className:Ne.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:E.join(", ")})]}),l.jsx("div",{className:Ne.unitContents,children:(C.children??[]).map(j=>{const P=oi(j),O=O2[P.key]??Wr,N=v(j);return l.jsxs("div",{className:Ne.contentRow,children:[l.jsx(O,{size:16,className:Ne.contentIcon}),l.jsx("span",{className:Ne.contentTitle,children:j.name}),N.length>0&&l.jsx("div",{className:Ne.contentSkills,children:N.map(R=>l.jsx("span",{className:Ne.skillPill,children:R},R))})]},j.id)})})]})]},C.id)})})]})]})})},N2="_backToPathButton_42cuj_1",j2="_assessmentTitle_42cuj_15",P2="_slotPills_42cuj_22",R2="_slotPill_42cuj_22",F2="_slotPillHint_42cuj_40",M2="_slotPillPurpose_42cuj_45",B2="_slotPillWarning_42cuj_51",q2="_slotPillPrimary_42cuj_56",$2="_courseCard_42cuj_62",U2="_courseCardHeading_42cuj_72",z2="_courseCardDescription_42cuj_79",V2="_courseNotAdded_42cuj_85",H2="_assessmentExplainer_42cuj_93",Q2="_assessmentExplainerHeading_42cuj_107",W2="_leafContentLayout_42cuj_117",G2="_container_42cuj_131",K2="_emptyState_42cuj_140",Y2="_titleRow_42cuj_150",Z2="_titleRowLp_42cuj_157",X2="_nodeTitle_42cuj_171",J2="_nodeTitleLpRoot_42cuj_193",eM="_nodeTitleSub_42cuj_198",tM="_courseDetailHeader_42cuj_203",rM="_courseDetailIcon_42cuj_210",nM="_courseDetailTitle_42cuj_222",sM="_courseDetailMeta_42cuj_229",iM="_formArea_42cuj_234",oM="_contentListArea_42cuj_238",aM="_contentListAreaLp_42cuj_242",lM="_dropZone_42cuj_246",cM="_reviewComment_42cuj_253",uM="_reviewCommentLabel_42cuj_266",dM="_reviewCommentText_42cuj_272",ke={backToPathButton:N2,assessmentTitle:j2,slotPills:P2,slotPill:R2,slotPillHint:F2,slotPillPurpose:M2,slotPillWarning:B2,slotPillPrimary:q2,courseCard:$2,courseCardHeading:U2,courseCardDescription:z2,courseNotAdded:V2,assessmentExplainer:H2,assessmentExplainerHeading:Q2,leafContentLayout:W2,container:G2,emptyState:K2,titleRow:Y2,titleRowLp:Z2,nodeTitle:X2,nodeTitleLpRoot:J2,nodeTitleSub:eM,courseDetailHeader:tM,courseDetailIcon:rM,courseDetailTitle:nM,courseDetailMeta:sM,formArea:iM,contentListArea:oM,contentListAreaLp:aM,dropZone:lM,reviewComment:cM,reviewCommentLabel:uM,reviewCommentText:dM},fM=({slot:e,isEditable:t})=>{var p;const r=oe(),n=re(b=>b.treeData),s=re(b=>b.selectNode),i=(p=n[0])==null?void 0:p.id,{pre:o,post:a}=Ql(),c=(e==="pre"?o:a).filled,u=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,d=e==="pre"?Bn:_y,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,m=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>i&&s(i),children:[l.jsx(wl,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:ke.assessmentTitle,children:u}),l.jsx("div",{className:ke.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillHint}`,children:[l.jsx(Ec,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPurpose}`,children:[l.jsx(Cy,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillWarning}`,children:[l.jsx(Uf,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${ke.slotPill} ${ke.slotPillPrimary}`,children:[l.jsx(Ec,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:ke.formArea,children:[l.jsxs("div",{className:ke.courseCard,children:[l.jsx("div",{className:ke.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:ke.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(dl,{slot:e,isEditable:t}):l.jsx("div",{className:ke.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:ke.assessmentExplainer,children:[l.jsxs("div",{className:ke.assessmentExplainerHeading,children:[l.jsx(d,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:m})]})]})]})},hM="application/vnd.sunbird.questionset",om="application/vnd.sunbird.question",pM=[hM,om];function kd(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const mM=({editorMode:e,onToolbarEvent:t})=>{var fe,pe,ae,we,ye;const r=oe(),[n,s]=g.useState("details"),[i,o]=g.useState([]),[a,c]=g.useState(null),[u,d]=g.useState(!1),[f,m]=g.useState(null),p=g.useRef(null),b=g.useRef(),{selectedNodeId:h,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:_}=re(),x=yr(F=>F.activeAssessmentSlot),E=K(F=>{var B,Z,he,be;return((Z=(B=F.editorConfig)==null?void 0:B.context)==null?void 0:Z.contentId)??((be=(he=F.editorConfig)==null?void 0:he.context)==null?void 0:be.identifier)??""}),D=K(F=>F.editorProfile.competencyScoped),T=h?am(S,h):null;g.useEffect(()=>{m(null)},[T==null?void 0:T.identifier]);const j=!!T&&!T.parent,P=!!(T!=null&&T.isFolder),O=T&&pM.includes(T.mimeType??""),N=(T==null?void 0:T.mimeType)===om,R=T&&!T.isFolder&&!O&&!j,$=D&&P&&lt(T??void 0)?((ae=(pe=(fe=S[0])==null?void 0:fe.children)==null?void 0:pe[0])==null?void 0:ae.id)===(T==null?void 0:T.id)?"pre":"post":D?x:null,ee=kd(T)??(j?kd(S[0]):void 0),H=g.useCallback(()=>{const F=p.current;if(!F||!h)return;const B=F.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(h,{name:B})},600)},[h,C]),te=g.useCallback(F=>{t({action:"onFormValueChange",data:F})},[t]),de=g.useCallback((F,B)=>{o(B),t({action:"onFormStatusChange",data:{isValid:F,nodeId:h}})},[t,h]);if(!T)return l.jsx("div",{className:ke.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(O)return l.jsx(fl,{node:T,editorMode:e,type:"quml",singleQuestion:N});if(D&&R&&T.primaryCategory==="Course"){const F=T.parent?f0(((we=S[0])==null?void 0:we.children)??[],T.parent):null,B=(F==null?void 0:F.role)==="pre"?r.learningPath.priorAssessmentLabel:(F==null?void 0:F.role)==="post"?r.learningPath.outcomeAssessmentLabel:(F==null?void 0:F.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String(F.levelNumber)):null,Z=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:ke.container,children:[l.jsxs("button",{type:"button",className:ke.backToPathButton,onClick:()=>T.parent&&_(T.parent),children:[l.jsx(wl,{size:14}),B?r.learningPath.backToLevelButton.replace("{label}",B):r.learningPath.backToPathButton]}),l.jsxs("div",{className:ke.courseDetailHeader,children:[l.jsx("span",{className:ke.courseDetailIcon,children:l.jsx(Qr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:ke.courseDetailTitle,children:T.name}),l.jsxs("span",{className:ke.courseDetailMeta,children:[T.primaryCategory,Z]})]})]}),l.jsx(im,{courseId:T.identifier,variant:"full",title:T.name,onLoaded:({totalContents:he})=>m(he)},T.identifier)]})}return $?l.jsx(fM,{slot:$,isEditable:e==="edit"}):R?l.jsxs("div",{className:ke.leafContentLayout,children:[l.jsx(fl,{node:T,editorMode:e,type:"content",layout:"flow"}),l.jsx(KF,{node:T,editorMode:e,onMoveClick:()=>c(T.identifier),reorderDialog:a?l.jsx(gF,{resourceId:a,resourceName:T.name,currentUnitId:T.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:ke.container,children:[l.jsx(ML,{crumbs:v}),ee&&l.jsxs("div",{className:ke.reviewComment,role:"alert",children:[l.jsx("span",{className:ke.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:ke.reviewCommentText,children:ee})]}),l.jsxs("div",{className:[ke.titleRow,D?ke.titleRowLp:""].filter(Boolean).join(" "),children:[j&&h&&l.jsx(t2,{nodeId:h,value:String(T.appIcon??((ye=T.metadata)==null?void 0:ye.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:p,className:[ke.nodeTitle,D&&j?ke.nodeTitleLpRoot:"",D&&!j?ke.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:H,onBlur:H,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:T.name})]}),l.jsx(VL,{activeTab:n,onChange:F=>s(F),errorTabs:i,visibleTabs:j&&!D?void 0:["details"]}),l.jsx("div",{className:ke.formArea,children:l.jsx(Bj,{nodeMetadata:y,activeTab:n,isRoot:j,isFolder:P,editorMode:e,onFormValueChange:te,onFormStatusChange:de},`${h??"none"}:${j?"root":"node"}`)}),(P||j)&&n==="details"&&l.jsx("div",{className:[ke.contentListArea,D?ke.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(nR,{editorMode:e,isRoot:j})}),l.jsx(oR,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:h??void 0,className:ke.dropZone}),u&&l.jsx(kF,{contentId:E,onClose:()=>d(!1)})]})};function am(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=am(r.children,t);if(n)return n}}}const lm=ei((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const i=[...t().allContent,...r];e({allContent:i,totalCount:n,offset:i.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:s}=t();let i=r;if(n&&n!=="all"){const o=n.toLowerCase();i=i.filter(a=>[a.mimeType??"",a.primaryCategory??"",a.contentType??""].join(" ").toLowerCase().includes(o))}if(s&&s.trim()!==""){const o=s.toLowerCase().trim();i=i.filter(a=>(a.name??"").toLowerCase().includes(o))}e({filteredContent:i})}}));function gM(e,t,r,n){const s={primaryCategory:["Course"]};return n&&(s.framework=[n]),!e&&t.length&&r&&(s[r]=t),s}function vM(e,t){if(!(!e||!t))return[...tm,t,"framework"]}function yM(e,t,r,n,s){return e?t?r&&!n&&s.length===0?"noSkills":null:"noCurriculum":null}const bM=20,CM=[];function cm(){var u;const e=K(d=>d.editorConfig),t=re(d=>d.selectedNodeId),r=re(d=>d.treeData),n=g.useCallback(()=>{if(!t||!r.length)return 0;function d(f,m,p=0){var b;for(const h of f){if(h.id===m)return p;if((b=h.children)!=null&&b.length){const v=d(h.children,m,p+1);if(v>=0)return v}}return-1}return Math.max(0,d(r,t))},[t,r])(),s=(u=e==null?void 0:e.config)==null?void 0:u.hierarchy;if(!s)return[...id];const i=`level${n}`,o=s[i],a=o==null?void 0:o.children,c=a==null?void 0:a.Content;return c!=null&&c.length?c:[...id]}function SM(){const e=lm(),t=K(T=>{var j,P;return((P=(j=T.editorConfig)==null?void 0:j.context)==null?void 0:P.channel)??""}),r=cm(),n=K(T=>T.editorProfile),s=yr(T=>T.activeAssessmentSlot),i=re(T=>T.activeNodeMeta),o=re(T=>T.treeData),a=re(T=>T.treeCache),c=re(T=>T.selectedNodeId),u=re(T=>T.getNodeById),d=lr(),f=n.competencyScoped?xh(o[0],a):void 0,m=g.useRef(),p=d&&Array.isArray(i[d.code])?i[d.code]:CM,b=c?u(c):void 0,h=n.competencyScoped&&!!(b!=null&&b.isFolder)&&!!b.parent&&!lt(b),v=yM(n.competencyScoped,f,h,s,p),y=g.useCallback(async(T="",j="all",P={},O=!0,N=!1)=>{var R,M,$,ee,H;e.setLoading(!0);try{if(v){e.setContent([],0);return}let te;if(n.competencyScoped){const ae=gM(s,p,d==null?void 0:d.code,f);te={status:["Live"],...ae}}else te={status:["Live"],primaryCategory:j&&j!=="all"?[j]:r},(R=P==null?void 0:P.board)!=null&&R.length&&(te.board=P.board),(M=P==null?void 0:P.medium)!=null&&M.length&&(te.medium=P.medium),($=P==null?void 0:P.gradeLevel)!=null&&$.length&&(te.gradeLevel=P.gradeLevel),(ee=P==null?void 0:P.subject)!=null&&ee.length&&(te.subject=P.subject),(H=P==null?void 0:P.primaryCategory)!=null&&H.length&&(te.primaryCategory=P.primaryCategory);const de=O?0:e.offset,{content:fe,count:pe}=await aR({filters:te,query:T,limit:T?50:bM,offset:de,channel:t||void 0,sortBy:N?{name:"asc"}:{lastUpdatedOn:"desc"},fields:vM(n.competencyScoped,d==null?void 0:d.code)});O?e.setContent(fe,pe):e.appendContent(fe,pe)}catch(te){console.error("[useLibrary] load error:",te)}finally{e.setLoading(!1)}},[r,t,n,s,p,d,f,v]);g.useEffect(()=>{clearTimeout(m.current),e.setSearch("")},[f]),g.useEffect(()=>{y()},[t]),g.useEffect(()=>{n.competencyScoped&&y()},[n.competencyScoped,s,p.join("|"),f,c]);const C=g.useCallback(T=>{e.setSearch(T),clearTimeout(m.current),m.current=setTimeout(()=>y(T,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,y]),S=g.useCallback(T=>{e.setFilter(T),y(e.searchQuery,T,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,y]),_=g.useCallback(T=>{e.setAdvancedFilters(T),y(e.searchQuery,e.activeFilter,T,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,y]),x=g.useCallback(()=>{const T=!e.sortAZ;e.setSortAZ(T),y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,T)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,y]),E=g.useCallback(()=>{e.isLoading||y(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,y]),D=e.allContent.length<e.totalCount;return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:D,search:C,setFilter:S,applyAdvancedFilters:_,toggleSort:x,loadMore:E,refetch:()=>y(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:v}}function um(){var a;const e=oe(),t=K(c=>c.editorProfile.competencyScoped),r=yr(c=>c.activeAssessmentSlot),n=re(c=>c.selectedNodeId),s=re(c=>c.treeData),i=re(c=>c.getNodeById),o=(a=s[0])==null?void 0:a.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n&&n!==o){const c=i(n);if(c!=null&&c.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",c.name??"")}return e.learningPath.libraryOpenLevelToAdd}const _M="_card_1cmpg_1",wM="_addBtn_1cmpg_17",xM="_dragging_1cmpg_24",TM="_ctIcon_1cmpg_29",EM="_info_1cmpg_33",AM="_name_1cmpg_41",kM="_meta_1cmpg_50",IM="_skillTags_1cmpg_58",DM="_skillTag_1cmpg_58",LM="_addBtnMuted_1cmpg_93",OM="_added_1cmpg_102",NM="_addedBadge_1cmpg_111",Kt={card:_M,addBtn:wM,dragging:xM,ctIcon:TM,info:EM,name:AM,meta:kM,skillTags:IM,skillTag:DM,addBtnMuted:LM,added:OM,addedBadge:NM},jM={video:_o,pdf:Js,h5p:yo,scorm:Co,audio:bo,quiz:vo,course:Qr,default:Wr},PM=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{var S,_;const i=oe(),o=oi(e),a=jM[o.key]??Wr,c=Hl(),u=pD(),d=c&&!s&&u,f=K(x=>x.editorProfile.competencyScoped),m=lr(),p=f&&m?(()=>{const x=e[m.code];return Array.isArray(x)?x:x?[String(x)]:[]})():[],{attributes:b,listeners:h,setNodeRef:v,isDragging:y}=Nf({id:e.identifier,disabled:!n||!c||!u,data:{type:"library-item",item:e}}),C=()=>{r&&r(e)};return l.jsxs("div",{ref:v,className:[Kt.card,y?Kt.dragging:"",s?Kt.added:""].join(" "),"aria-label":e.name,...n?{...b,...h}:{},role:"listitem",onClick:C,children:[l.jsx("span",{className:[`sbx-ct-sq--${o.key}`,Kt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(a,{size:14})}),l.jsxs("div",{className:Kt.info,children:[l.jsx("span",{className:Kt.name,title:e.name,children:e.name}),l.jsxs("span",{className:Kt.meta,children:[((S=e.organisation)==null?void 0:S[0])??e.channel??"",(_=e.organisation)!=null&&_[0]&&e.primaryCategory?" · ":"",e.primaryCategory??""]}),p.length>0&&l.jsx("span",{className:Kt.skillTags,children:p.slice(0,3).map(x=>l.jsx("span",{className:Kt.skillTag,children:x},x))})]}),s&&l.jsx("span",{className:Kt.addedBadge,"aria-label":i.libraryCard.alreadyAddedAriaLabel,title:i.libraryCard.alreadyAddedTitle,children:l.jsx(bn,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Kt.addBtn,!d&&c?Kt.addBtnMuted:""].join(" "),onClick:x=>{x.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!d,"aria-label":i.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?u?i.libraryCard.addToUnitTitle:i.libraryCard.selectUnitToAddTitle:i.libraryCard.draftOnlyTitle,children:l.jsx(Sn,{size:14})})]})},RM="_chips_xhhaq_1",FM="_chip_xhhaq_1",Id={chips:RM,chip:FM},MM=({filters:e,active:t,onChange:r})=>{const n=oe();return l.jsx("div",{className:Id.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",Id.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},BM="_panel_uame3_1",qM="_header_uame3_10",$M="_headerTitle_uame3_19",UM="_closeBtn_uame3_25",zM="_body_uame3_43",VM="_section_uame3_59",HM="_sectionLabel_uame3_65",QM="_chips_uame3_73",WM="_chip_uame3_73",GM="_active_uame3_96",KM="_footer_uame3_102",YM="_resetBtn_uame3_112",ZM="_applyBtn_uame3_129",ht={panel:BM,header:qM,headerTitle:$M,closeBtn:UM,body:zM,section:VM,sectionLabel:HM,chips:QM,chip:WM,active:GM,footer:KM,resetBtn:YM,applyBtn:ZM},XM=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],JM=new Set(["board","medium","gradeLevel","subject","topic"]),eB=({local:e,toggle:t})=>{const r=oe(),n=cm();return n.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:ht.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[ht.chip,(e.primaryCategory??[]).includes(s)?ht.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},tB=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=oe(),i=K(C=>C.editorConfig),o=K(C=>C.searchFormConfig),a=K(C=>C.contentFramework),c=K(C=>C.contentTargetFWIds),{organisationFramework:u}=Ao(a??((v=i==null?void 0:i.context)==null?void 0:v.framework),c??((y=i==null?void 0:i.context)==null?void 0:y.targetFWIds)),[d,f]=g.useState(t),m=o!=null&&o.length?o.filter(C=>JM.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):XM(s);g.useEffect(()=>{f(t)},[t]);const p=(C,S)=>{f(_=>{const x=_[C]??[],E=x.includes(S)?x.filter(D=>D!==S):[...x,S];return{..._,[C]:E}})},b=(u==null?void 0:u.categories)??[],h=C=>{var S;return((S=b.find(_=>_.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:ht.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:ht.header,children:[l.jsx("span",{className:ht.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:ht.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(br,{size:16})})]}),l.jsxs("div",{className:ht.body,children:[m.map(({key:C,label:S})=>{const _=h(C);return _.length?l.jsxs("div",{className:ht.section,children:[l.jsx("div",{className:ht.sectionLabel,children:S}),l.jsx("div",{className:ht.chips,children:_.slice(0,20).map(x=>l.jsx("button",{type:"button",className:[ht.chip,(d[C]??[]).includes(x.name)?ht.active:""].join(" "),onClick:()=>p(C,x.name),children:x.name},x.identifier))})]},C):null}),l.jsx(eB,{local:d,toggle:p})]}),l.jsxs("div",{className:ht.footer,children:[l.jsx("button",{type:"button",className:ht.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:ht.applyBtn,onClick:()=>{r(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},rB="_header_1tvk1_10",nB="_headerCourse_1tvk1_20",sB="_courseIcon_1tvk1_25",iB="_titleGroup_1tvk1_37",oB="_courseMeta_1tvk1_45",aB="_title_1tvk1_37",lB="_headerActions_1tvk1_67",cB="_iconBtn_1tvk1_74",uB="_playerArea_1tvk1_92",dB="_footer_1tvk1_100",fB="_footerCourse_1tvk1_109",hB="_addBtn_1tvk1_115",pB="_addBtnCourse_1tvk1_134",mB="_modalOverlay_1tvk1_159",gB="_modalOverlayCourse_1tvk1_174",vB="_modalPanel_1tvk1_178",yB="_modalPanelCourse_1tvk1_190",gt={header:rB,headerCourse:nB,courseIcon:sB,titleGroup:iB,courseMeta:oB,title:aB,headerActions:lB,iconBtn:cB,playerArea:uB,footer:dB,footerCourse:fB,addBtn:hB,addBtnCourse:pB,modalOverlay:mB,modalOverlayCourse:gB,modalPanel:vB,modalPanelCourse:yB},bB="application/vnd.sunbird.questionset",CB=({content:e,editorMode:t,onAdd:r,onClose:n})=>{var f;const s=oe(),i=t==="edit",o=K(m=>m.editorProfile.competencyScoped),a=um();if(!e)return null;const c=o&&e.primaryCategory==="Course",u=[((f=e.organisation)==null?void 0:f[0])??e.channel??"",e.primaryCategory??""].filter(Boolean).join(" • "),d={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return xr.createPortal(l.jsx("div",{className:[gt.modalOverlay,c?gt.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[gt.modalPanel,c?gt.modalPanelCourse:""].filter(Boolean).join(" "),onClick:m=>m.stopPropagation(),children:[l.jsxs("div",{className:[gt.header,c?gt.headerCourse:""].filter(Boolean).join(" "),children:[c&&l.jsx("span",{className:gt.courseIcon,children:l.jsx(Qr,{size:20})}),l.jsxs("div",{className:gt.titleGroup,children:[l.jsx("span",{className:gt.title,title:e.name,children:e.name}),c&&u&&l.jsx("span",{className:gt.courseMeta,children:u})]}),l.jsx("div",{className:gt.headerActions,children:l.jsx("button",{type:"button",className:gt.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(br,{size:16})})})]}),l.jsx("div",{className:gt.playerArea,children:c?l.jsx(im,{courseId:e.identifier}):l.jsx(fl,{node:d,editorMode:"read",type:e.mimeType===bB?"quml":"content"})}),i&&l.jsx("div",{className:[gt.footer,c?gt.footerCourse:""].filter(Boolean).join(" "),children:c?l.jsxs("button",{type:"button",className:gt.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Sn,{size:15})," ",a??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:gt.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},SB="_dock_2k0x7_1",_B="_header_2k0x7_8",wB="_libraryTargetLabel_2k0x7_18",xB="_headerLeft_2k0x7_28",TB="_headerTitle_2k0x7_36",EB="_count_2k0x7_42",AB="_searchRow_2k0x7_51",kB="_searchWrap_2k0x7_59",IB="_searchIcon_2k0x7_65",DB="_searchInput_2k0x7_74",LB="_filterToggleBtn_2k0x7_92",OB="_filterToggleBtnActive_2k0x7_111",NB="_filterBadge_2k0x7_117",jB="_filters_2k0x7_136",PB="_mainArea_2k0x7_146",RB="_sidePanelOverlay_2k0x7_155",FB="_cardList_2k0x7_164",MB="_skeleton_2k0x7_180",BB="_skeletonIcon_2k0x7_190",qB="_skeletonText_2k0x7_198",$B="_skeletonLine_2k0x7_205",UB="_skeletonLineSm_2k0x7_212",zB="_loadMoreBtn_2k0x7_227",VB="_emptyState_2k0x7_252",HB="_collapseBtn_2k0x7_272",ze={dock:SB,header:_B,libraryTargetLabel:wB,headerLeft:xB,headerTitle:TB,count:EB,searchRow:AB,searchWrap:kB,searchIcon:IB,searchInput:DB,filterToggleBtn:LB,filterToggleBtnActive:OB,filterBadge:NB,filters:jB,mainArea:PB,sidePanelOverlay:RB,cardList:FB,skeleton:MB,skeletonIcon:BB,skeletonText:qB,skeletonLine:$B,skeletonLineSm:UB,loadMoreBtn:zB,emptyState:VB,collapseBtn:HB},QB=[{label:"Courses",value:"all"}];function WB(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const GB=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=oe(),{content:s,isLoading:i,totalCount:o,activeFilter:a,searchQuery:c,sortAZ:u,hasMore:d,search:f,setFilter:m,applyAdvancedFilters:p,toggleSort:b,loadMore:h,activeAssessmentSlot:v,emptyReason:y}=SM(),{addResource:C,selectedNodeId:S,treeData:_,treeCache:x}=re(),E=yr(F=>F.setActiveAssessmentSlot),D=K(F=>F.editorProfile.competencyScoped),T=e==="edit",j=um(),[P,O]=g.useState(!1),[N,R]=g.useState({}),[M,$]=g.useState(null),[ee,H]=g.useState(null),te=g.useMemo(()=>WB(_),[_]),de=g.useCallback(async(F,B)=>{var he,be;const Z=(he=_[0])==null?void 0:he.id;if(!(!Z||ee)){if(Ms(((be=_[0])==null?void 0:be.children)??[],B)){Se.error(B==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}H(F.identifier);try{const{qualifies:me,meta:le}=await _h(F.identifier);if(!me){Se.error(n.learningPath.notAssessmentCourseToast.replace("{name}",F.name));return}const ve={...F,...le};if(C(ve,Z,{isAssessmentCourse:!0,slot:B})===!1){Se.error(n.learningPath.bothSlotsFilledToast);return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",F.name)),E(null)}catch(me){console.error("[LibraryDock] assessment-course check failed:",me),Se.error(n.learningPath.assessmentCheckFailedToast)}finally{H(null)}}},[_,C,E,ee,n]),fe=g.useCallback(F=>{var be,me,le;if(D&&!Th(_[0],x)){Se.error(n.learningPath.selectCurriculumFirstToast);return}if(v){de(F,v);return}if(!S){Se.error(D?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const B=(be=_[0])==null?void 0:be.id,Z=re.getState().getNodeById(S);if(D){const ve=((me=_[0])==null?void 0:me.children)??[],Te=Z!=null&&Z.isFolder?Z:Z!=null&&Z.parent?re.getState().getNodeById(Z.parent):void 0;if(Te&&Wa(ve,Te)){const Y=(le=ve[0])==null?void 0:le.id;Se.error(Te.id===Y?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(S===B||!(Z!=null&&Z.isFolder)){Se(D?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Bn,{size:16}),duration:4e3});return}if(C(F,S)===!1){Se.error((D?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",F.name));return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",F.name))},[v,de,S,C,_,x,n,D]),pe=g.useCallback(F=>{R(F),p(F)},[p]),ae=g.useCallback(F=>{$(F)},[]),we=g.useCallback(F=>{fe(F),$(null)},[fe]),ye=g.useMemo(()=>Object.values(N).reduce((F,B)=>F+((B==null?void 0:B.length)??0),0),[N]);return l.jsxs("div",{className:ze.dock,children:[l.jsxs("div",{className:ze.header,children:[l.jsxs("div",{className:ze.headerLeft,children:[l.jsx("button",{type:"button",className:ze.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Ry,{size:15})}),l.jsx(Oy,{size:16}),l.jsx("span",{className:ze.headerTitle,children:n.libraryDock.headerTitle}),o>0&&l.jsx("span",{className:ze.count,children:o})]}),j&&l.jsx("span",{className:ze.libraryTargetLabel,children:j})]}),l.jsxs("div",{className:ze.searchRow,children:[l.jsxs("div",{className:ze.searchWrap,children:[l.jsx(Yi,{size:14,className:ze.searchIcon}),l.jsx("input",{type:"search",className:ze.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:F=>f(F.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[ze.filterToggleBtn,u?ze.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?l.jsx(Sy,{size:15}):l.jsx(Ey,{size:15})}),!D&&l.jsxs("button",{type:"button",className:[ze.filterToggleBtn,P?ze.filterToggleBtnActive:""].join(" "),onClick:()=>O(F=>!F),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":P,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Vy,{size:15}),ye>0&&l.jsx("span",{className:ze.filterBadge,children:ye})]})]}),l.jsx("div",{className:ze.filters,children:l.jsx(MM,{filters:D?QB:mD,active:a,onChange:m})}),l.jsxs("div",{className:ze.mainArea,children:[l.jsx("div",{className:ze.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:i&&s.length===0?Array.from({length:4}).map((F,B)=>l.jsxs("div",{className:ze.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:ze.skeletonIcon}),l.jsxs("div",{className:ze.skeletonText,children:[l.jsx("div",{className:ze.skeletonLine}),l.jsx("div",{className:ze.skeletonLineSm})]})]},B)):s.length>0?l.jsxs(l.Fragment,{children:[s.map(F=>l.jsx(PM,{item:F,onAdd:fe,onPreview:ae,isDraggable:T,isAdded:te.has(F.identifier)},F.identifier)),d&&l.jsx("button",{type:"button",className:ze.loadMoreBtn,onClick:h,disabled:i,"aria-label":n.libraryDock.loadMoreAriaLabel,children:i?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]}):l.jsxs("div",{className:ze.emptyState,children:[l.jsx(Yi,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):y==="noSkills"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noSkillsEmptyTitle}),l.jsx("span",{children:n.learningPath.noSkillsEmptyHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]})}),P&&l.jsx("div",{className:ze.sidePanelOverlay,children:l.jsx(tB,{isOpen:P,filters:N,onApply:pe,onClose:()=>O(!1)})}),M&&l.jsx(CB,{content:M,editorMode:e,onAdd:we,onClose:()=>$(null)})]})]})};function KB(e,t,r,n=Al){const s={},i={},o=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),a=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","industry","domain","dialcodes"]),u=new Set(["copyrightYear","compatibilityLevel","version"]);function d(p,b=!1){const h={};for(const[v,y]of Object.entries(p))if(!o.has(v)&&!(b&&a.has(v)))if(c.has(v))Array.isArray(y)?h[v]=y:y!=null&&y!==""?h[v]=[y]:h[v]=[];else if(u.has(v)){const C=Number(y);isNaN(C)||(h[v]=C)}else h[v]=y;return h}function f(p){var h;const b={};for(const v of p.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const _=((h=v.metadata)==null?void 0:h.relationalMetadata)??{};b[v.identifier]={name:v.name,..._,...S}}return b}function m(p,b){var _,x;const h=p.identifier,v=t[h],y=h.startsWith("temp-")||!!(v!=null&&v.isNew),C=!p.isFolder&&!b;if(b||y||v&&!C){let E;if(y)E={mimeType:"application/vnd.ekstep.content-collection",code:h,contentType:((_=p.metadata)==null?void 0:_.contentType)??n.unitContentType,primaryCategory:((x=p.metadata)==null?void 0:x.primaryCategory)??n.unitPrimaryCategory,name:p.name,visibility:"Parent",channel:r,...d(p.metadata??{})};else if(b){const{isNew:D,...T}=v??{};E={...d(p.metadata??{},!0),...d(T,!1),name:p.name}}else{const{isNew:D,...T}=v??{};E={name:p.name,visibility:"Parent",...d(T,!0)}}s[h]={metadata:E,objectType:p.objectType||(p.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=p.isFolder?f(p):{};i[h]={name:p.name,children:(p.children??[]).map(E=>E.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(p.children??[]).forEach(E=>m(E,!1))}return e.forEach((p,b)=>m(p,b===0)),{nodesModified:s,hierarchy:i}}function YB(){const[e,t]=g.useState(!1),r=re(d=>d.treeCache),n=re(d=>d.treeData),s=K(d=>d.isDirty),i=K(d=>d.lastSaved),{setIsDirty:o,setLastSaved:a}=K(),c=K(d=>d.editorConfig);return{save:g.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;if(n.length===0){Se.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",m=c.context.userId??c.context.uid??"";t(!0);try{const p=K.getState().editorProfile,{nodesModified:b,hierarchy:h}=KB(n,r,f,p),{identifiers:v}=await n0(d,b,h,m);v&&Object.keys(v).length>0&&re.getState().replaceNodeIds(v);const y=new Date().toISOString();a(y),o(!1)}catch(p){console.error("[useSaveHierarchy] save failed:",p),Se.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,o,a]),isSaving:e,isDirty:s,lastSaved:i}}const ZB={};function XB(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function JB(e,t,r,n,s,i=ZB){const o=[],a=(c,u)=>{var d;for(const f of c){const m=u&&!f.parent,p=m?r:f.isFolder?n:null;if(p&&p.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=Vp(p,b,i,m,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&XB(y.currentValue)).map(y=>y.label);v.length>0&&o.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(d=f.children)!=null&&d.length&&a(f.children,!1)}};return a(e,!0),o}function eq(e){var S,_;const t=K(x=>x.editorConfig),r=K(x=>x.editorProfile),n=K(x=>x.setButtonLoader),s=K(x=>x.validateAllForms),i=K(x=>x.rootFormConfig),o=K(x=>x.unitFormConfig),a=re(x=>x.treeData),c=re(x=>x.treeCache),u=re(x=>x.selectNode),d=lr(),{scope:f}=ii(),m=K(x=>x.contentFramework),p=K(x=>x.contentTargetFWIds),{organisationFramework:b,targetFrameworks:h}=Ao(m??((S=t==null?void 0:t.context)==null?void 0:S.framework),p??((_=t==null?void 0:t.context)==null?void 0:_.targetFWIds)),v=g.useCallback(()=>{var j,P,O;const x={editorMode:"edit",objectType:(j=t==null?void 0:t.config)==null?void 0:j.objectType,userFullName:(O=(P=t==null?void 0:t.context)==null?void 0:P.user)==null?void 0:O.fullName},E=JB(a,c,i,o,x,{organisationFramework:b,targetFrameworks:h});if(E.length===0)return!0;const D=E[0];Se.error(`"${D.nodeName}": please fill required field${D.missing.length>1?"s":""} — ${D.missing.join(", ")}`);const{setFormStatus:T}=K.getState();return E.forEach(N=>T(N.nodeId,!1)),u(D.nodeId),!1},[a,c,i,o,t,u,b,h]),y=g.useCallback(()=>{if(r.key!=="learningPath")return!0;const x=Rl(a[0],d==null?void 0:d.code,f,c);return x.length===0?!0:(Se.error(x[0].message),!1)},[r.key,a,c,d,f]);return{runAction:g.useCallback(async(x,E)=>{var j,P,O,N;const D=((j=t==null?void 0:t.context)==null?void 0:j.contentId)??((P=t==null?void 0:t.context)==null?void 0:P.identifier)??"";if(!D)return Se.error("No content identifier found."),!1;const T=((O=t==null?void 0:t.context)==null?void 0:O.userId)??((N=t==null?void 0:t.context)==null?void 0:N.uid)??"";try{switch(x){case"sendForReview":return v()?s(a)?y()?(n("saveCollection",!0),await e(),await o0(D),Se.success("Content sent for review"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const R=(E==null?void 0:E.comment)??"";return await a0(D,R),Se.success("Content rejected and sent back to the author"),!0}case"publish":return v()?s(a)?y()?(n("publishCollection",!0),await e(),await s0(D,T),Se.success("Content published successfully"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(R){console.error(`[useToolbarActions] ${x} failed`,R);const M=x==="sendForReview"?"send for review":x==="reject"?"reject":"publish";return Se.error(`Failed to ${M}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,v,y,s,a]),checkRequiredFields:v}}function tq(){const e=oe(),t=K(c=>c.editorProfile.key==="learningPath"),r=re(c=>c.treeData),n=lr(),{scope:s,source:i}=ii(),o=g.useRef(!1),a=g.useRef("");g.useEffect(()=>{if(!t||i!=="prior"||!n)return;const c=g0(r[0],n.code,s),u=c.map(d=>d.id).sort().join(",");o.current?c.length>0&&u!==a.current&&Se.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):o.current=!0,a.current=u},[t,i,s.join("|"),n==null?void 0:n.code,r])}function rq(){const e=K(o=>o.editorProfile.key==="learningPath"),t=re(o=>o.treeData),r=re(o=>o.treeCache),n=re(o=>o.updateNode),s=lr(),i=s==null?void 0:s.code;g.useEffect(()=>{if(!e||!i)return;const o=t[0],a=m0(o,i,r);a!==null&&n(o.id,{[i]:a},[i])},[e,t,r,i,n])}const nq="_shell_fu72l_1",sq="_workspace_fu72l_8",iq="_sidebarCollapsed_fu72l_16",oq="_dockCollapsed_fu72l_19",aq="_dock_fu72l_19",lq="_outline_fu72l_40",cq="_reopenTab_fu72l_45",uq="_outlineHidden_fu72l_79",dq="_editor_fu72l_86",fq="_editorLp_fu72l_92",hq="_dockHidden_fu72l_105",pq="_dockReopenTab_fu72l_112",mq="_dragChip_fu72l_137",gq="_dragChipLabel_fu72l_152",Ot={shell:nq,workspace:sq,sidebarCollapsed:iq,dockCollapsed:oq,dock:aq,outline:lq,reopenTab:cq,outlineHidden:uq,editor:dq,editorLp:fq,dockHidden:hq,dockReopenTab:pq,dragChip:mq,dragChipLabel:gq},vq=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=oe(),[i,o]=g.useState(null),[a,c]=g.useState(!1),[u,d]=g.useState(!1),[f,m]=g.useState(!1);tq(),rq();const{addResource:p,treeData:b,treeCache:h}=re(),v=K(H=>H.setFormStatus),y=K(H=>H.editorProfile.key==="learningPath"),[C,S]=g.useState(!0),_=re(H=>H.selectedNodeId),{save:x,isSaving:E,isDirty:D,lastSaved:T}=YB(),{runAction:j,checkRequiredFields:P}=eq(x);g.useEffect(()=>{if(!D)return;const H=te=>{te.preventDefault(),te.returnValue=""};return window.addEventListener("beforeunload",H),()=>window.removeEventListener("beforeunload",H)},[D]);const O=hf(ja(po,{activationConstraint:{distance:8}})),N=g.useCallback(H=>{var de;const te=(de=H.active.data.current)==null?void 0:de.item;te&&o(te)},[]),R=g.useCallback(H=>{var F,B,Z,he,be;o(null);const te=(F=H.active.data.current)==null?void 0:F.item;if(!te)return;if(y&&!Th(b[0],h)){Se.error(s.learningPath.selectCurriculumFirstToast);return}const de=H.over,fe=(de==null?void 0:de.id)??_??void 0,pe=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!fe){Se.error(pe);return}const ae=(B=b[0])==null?void 0:B.id;if(fe===ae){Se.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const we=re.getState().getNodeById(fe);if(!(we!=null&&we.isFolder)){Se.error(pe);return}if(y&&lt(we)){const me=(be=(he=(Z=b[0])==null?void 0:Z.children)==null?void 0:he[0])==null?void 0:be.id;Se.error(we.id===me?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!p(te,fe)){Se.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",te.name));return}r==null||r(te,fe),Se.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",te.name))},[_,p,b,h,r,s,y]),M=g.useCallback(async H=>{if(H.action==="onFormStatusChange"){const{isValid:te,nodeId:de}=H.data??{},fe=te!==!1;S(fe),de&&v(de,fe);return}if(H.action==="back"&&D&&e==="edit"){m(!0);return}if(H.action==="saveCollection"){if(!C){Se.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!P())return;await x(),n==null||n(b),t==null||t(H);return}if(H.action==="sendForReview"||H.action==="reject"||H.action==="publish"){await j(H.action,H.data)&&(t==null||t(H));return}t==null||t(H)},[x,j,P,t,n,b,D,C,e,s]),$=g.useCallback(async()=>{if(!P()){m(!1);return}await x(),m(!1),n==null||n(b),t==null||t({action:"back"})},[x,P,n,t,b]),ee=g.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return l.jsxs(Of,{sensors:O,onDragStart:N,onDragEnd:R,children:[l.jsxs("div",{className:Ot.shell,children:[l.jsx(e1,{editorMode:e,isSaving:E,isDirty:D,lastSaved:T,isFormValid:C,onToolbarEvent:M}),l.jsxs("div",{className:[Ot.workspace,a?Ot.sidebarCollapsed:"",u?Ot.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Ot.outline,a?Ot.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":a,children:l.jsx(NL,{editorMode:e,collapsed:a,onToggleCollapse:()=>c(H=>!H)})}),a&&l.jsx("button",{className:Ot.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Ot.editor,y?Ot.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(mM,{editorMode:e,onToolbarEvent:M})}),l.jsx("aside",{className:[Ot.dock,u?Ot.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:l.jsx(GB,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(H=>!H)})}),u&&l.jsx("button",{className:Ot.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(gy,{dropAnimation:null,children:i?l.jsx("div",{className:Ot.dragChip,children:l.jsx("span",{className:Ot.dragChipLabel,children:i.name})}):null}),f&&l.jsx(t1,{onSave:$,onDiscard:ee,onCancel:()=>m(!1),isSaving:E})]})},yq="v1";function bq(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Dd(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:bq(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function Dr(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const s=n.name??void 0,i=n.fields.filter(o=>!!o.code).sort((o,a)=>(o.index??0)-(a.index??0));for(const o of i)r.push(Dd(o,s))}else n.code&&r.push(Dd(n));return r}function Cq(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function Sq(e,t,r="Collection",n=yq){var u,d;const i=(d=(u=(await Fe.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:u.result)==null?void 0:d.objectCategoryDefinition,o=(i==null?void 0:i.forms)??{},a=(i==null?void 0:i.objectMetadata)??{},c=a.config??{};return{rootForm:Dr(o.create),unitForm:Dr(o.unitMetadata),childForm:Dr(o.childMetadata),searchForm:Dr(o.search??o.searchConfig),relationalForm:Dr(o.relationalMetadata),publishChecklist:Dr(o.publishchecklist),reviewChecklist:Dr(o.review),rfcChecklist:Dr(o.requestforchangeschecklist),schemaDefaults:Cq(a.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Ld(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function _q({config:e,onError:t}){const[r,n]=g.useState(!0),[s,i]=g.useState(null),[o,a]=g.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f,setEditorProfile:m}=K(),{setTreeData:p,selectNode:b}=re();return g.useEffect(()=>{let h=!1;async function v(){var y,C,S;try{n(!0),i(null),e.apiBaseUrl&&gh(e.apiBaseUrl),c(e),u(e.config.mode),m(ub(e));const _=e.context.contentId??e.context.identifier??"",x=e.context.channel??"";let E;if(x)try{E=(y=await Up(x))==null?void 0:y.defaultFramework}catch{}let D=!1;if(_){const T=e.config.objectType==="QuestionSet";let{rootNode:j}=T?await r0(_):await bh(_);if(j&&e.config.primaryCategory==="Learning Path"&&(j=await u0(j)),!h&&(p(j?[j]:[]),j)){b(j.id);const{framework:M,targetFWIds:$}=Ld(j.metadata??{},E,e.context);f(M,$),D=!0}const P=e.config.primaryCategory??"Course",O=e.context.channel??"",N=e.config.categoryDefinitionApiVersion??"v1";try{const R=await Sq(P,O,e.config.objectType??"Collection",N);if(!h){d(R);const M=((C=R.sourcingSettings)==null?void 0:C.collection)??{},$={};M.maxDepth&&!e.config.maxDepth&&($.maxDepth=M.maxDepth),M.children&&!e.config.children&&($.children=M.children),M.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&($.hierarchy={...e.config.hierarchy??{},...M.hierarchy}),Object.keys($).length>0&&c({...e,config:{...e.config,...$}})}}catch{}}if(!h&&!D){const{framework:T,targetFWIds:j}=Ld({},E,e.context);f(T,j)}h||a(!0)}catch(_){if(!h){const x=_ instanceof Error?_:new Error(String(_));i(x),t==null||t(x)}}finally{h||n(!1)}}return v(),()=>{h=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:o}}function wq(){const e=kl(t=>t.setLanguage);g.useEffect(()=>{e(localStorage.getItem(qa)||"en",{broadcast:!1});const t=n=>{n.key===qa&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var i;const s=(i=n.detail)==null?void 0:i.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener($a,r),()=>{window.removeEventListener("storage",t),window.removeEventListener($a,r)}},[e])}const xq="_root_1itrv_1",Tq="_loadingState_1itrv_10",Eq="_loadingSpinner_1itrv_20",Aq="_errorState_1itrv_34",Ts={root:xq,loadingState:Tq,loadingSpinner:Eq,errorState:Aq},kq=new qm({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function Iq({error:e,onRetry:t}){const r=oe();return l.jsxs("div",{className:Ts.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class Dq extends g.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(Iq,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function Lq(e){wq();const t=oe(),{isLoading:r,error:n}=_q({config:e,onError:e.onError}),s=K(o=>o.editorMode),i=K(o=>o.editorProfile);return r?l.jsxs("div",{className:Ts.loadingState,children:[l.jsx("div",{className:Ts.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:Ts.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",Ts.root,i.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(vq,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const dm=e=>l.jsx(Dq,{onError:e.onError,children:l.jsxs(Um,{client:kq,children:[l.jsx(Lq,{...e}),l.jsx($g,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),oo=Symbol.for("r2wc.reactRender"),Od=Symbol.for("r2wc.shouldRender"),Ti=Symbol.for("r2wc.root");function Oq(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Nq(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Nd={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[oo]()}}),e[oo]()}};function jq(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},i=!1,o=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),u.attachShadow({mode:"open"})),u},a=Object.create(HTMLElement.prototype);a.constructor=o;var c=new Proxy(a,{has:function(u,d){return d in e.propTypes||d in a},set:function(u,d,f,m){return i&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Nd.expando(m,d,f),Reflect.set(u,d,f,m)):(Nd.expando(m,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return o.prototype=c,a.connectedCallback=function(){this[Od]=!0,this[oo]()},a.disconnectedCallback=function(){typeof r.createRoot=="function"?this[Ti].unmount():r.unmountComponentAtNode(this)},a[oo]=function(){if(this[Od]===!0){var u={};Object.keys(this).forEach(function(m){s[m]!==!1&&(u[m]=this[m])},this),i=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[Ti]||(this[Ti]=r.createRoot(d)),this[Ti].render(f)):r.render(f,d),i=!1}},e.propTypes&&(o.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return Oq(u)}):Object.keys(e.propTypes),a.attributeChangedCallback=function(u,d,f){var m=n.dashStyleAttributes?Nq(u):u;this[m]=f}),o}var Pn={},jd;function Pq(){if(jd)return Pn;jd=1;var e=xr;if(process.env.NODE_ENV==="production")Pn.createRoot=e.createRoot,Pn.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Pn.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},Pn.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return Pn}var Rq=Pq();const Fq=Tl(Rq);function Mq(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function Bq(e="sb-collection-editor"){if(Mq(),typeof customElements>"u"||customElements.get(e))return;const t=jq(dm,g,Fq,{});customElements.define(e,t)}exports.CollectionEditor=dm;exports.registerCollectionEditor=Bq;exports.setApiBaseUrl=gh;exports.useEditorStore=K;exports.useLibraryStore=lm;exports.useTreeStore=re;
528
+ */var yu;function cC(){return yu||(yu=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,r=ec(),n=typeof Object.is=="function"?Object.is:e,s=r.useSyncExternalStore,o=t.useRef,a=t.useEffect,i=t.useMemo,c=t.useDebugValue;gi.useSyncExternalStoreWithSelector=function(u,d,f,m,h){var b=o(null);if(b.current===null){var p={hasValue:!1,value:null};b.current=p}else p=b.current;b=i(function(){function y(w){if(!C){if(C=!0,S=w,w=m(w),h!==void 0&&p.hasValue){var E=p.value;if(h(E,w))return x=E}return x=w}if(E=x,n(S,w))return E;var k=m(w);return h!==void 0&&h(E,k)?(S=w,E):(S=w,x=k)}var C=!1,S,x,_=f===void 0?null:f;return[function(){return y(d())},_===null?void 0:function(){return y(_())}]},[d,f,m,h]);var v=s(u,b[0],b[1]);return a(function(){p.hasValue=!0,p.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),gi}var bu;function uC(){return bu||(bu=1,process.env.NODE_ENV==="production"?Ro.exports=lC():Ro.exports=cC()),Ro.exports}var dC=uC();const fC=Jl(dC),Mh={},{useDebugValue:hC}=g,{useSyncExternalStoreWithSelector:pC}=fC;let Cu=!1;const mC=e=>e;function gC(e,t=mC,r){(Mh?"production":void 0)!=="production"&&r&&!Cu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Cu=!0);const n=pC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return hC(n),n}const Su=e=>{(Mh?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?oC(e):e,r=(n,s)=>gC(t,n,s);return Object.assign(r,t),r},xo=e=>e?Su(e):Su,za={key:"collection",unitPrimaryCategory:"Course Unit",unitContentType:"CourseUnit",unitLabelKey:"unit",defaultUnitName:"Untitled Unit",maxDepth:4,linkedLeavesOnly:!1,leafPrimaryCategories:[],derivedRoles:!1,competencyScoped:!1,features:{csvUpload:!0,dialcodes:!0,pageNumbers:!0,bulkUpload:!0,collaborators:!0}},vC={key:"learningPath",unitPrimaryCategory:"Level",unitContentType:"Level",unitLabelKey:"level",defaultUnitName:"Untitled Level",maxDepth:1,linkedLeavesOnly:!0,leafPrimaryCategories:["Course"],derivedRoles:!0,competencyScoped:!0,features:{csvUpload:!1,dialcodes:!1,pageNumbers:!1,bulkUpload:!1,collaborators:!1}},yC={...za,key:"evaluationCourse",restrictedContentCategories:["Practice Question Set","Course Assessment"]};function bC(e){switch(e.config.primaryCategory){case"Learning Path":return vC;case"Evaluation Course":return yC;default:return za}}const Z=xo(e=>({editorConfig:null,editorMode:"edit",buttonLoaders:{saveCollection:!1,publishCollection:!1,addFromLibrary:!1,rejectCollection:!1,sourcingApproveCollection:!1,sourcingRejectCollection:!1},showPreview:!1,pageId:"collection_editor",isCurrentNodeFolder:!1,isCurrentNodeRoot:!1,isQumlPlayer:!1,isDirty:!1,lastSaved:null,formStatusMapper:{},contentFramework:null,contentTargetFWIds:null,editorProfile:za,rootFormConfig:null,unitFormConfig:null,childFormConfig:null,searchFormConfig:null,relationalFormConfig:null,publishChecklist:null,reviewChecklist:null,rfcChecklist:null,categoryMeta:null,setEditorConfig:t=>e({editorConfig:t}),setEditorProfile:t=>e({editorProfile:t}),setEditorMode:t=>e({editorMode:t}),setButtonLoader:(t,r)=>e(n=>({buttonLoaders:{...n.buttonLoaders,[t]:r}})),setShowPreview:t=>e({showPreview:t}),setPageId:t=>e({pageId:t}),setNodeFlags:t=>e({...t.isFolder!==void 0&&{isCurrentNodeFolder:t.isFolder},...t.isRoot!==void 0&&{isCurrentNodeRoot:t.isRoot},...t.isQuml!==void 0&&{isQumlPlayer:t.isQuml}}),setLastSaved:t=>e({lastSaved:t}),setIsDirty:t=>e({isDirty:t}),setContentFramework:(t,r)=>e({contentFramework:t,contentTargetFWIds:r}),setFormStatus:(t,r)=>e(n=>({formStatusMapper:{...n.formStatusMapper,[t]:r}})),validateAllForms:t=>{const r=Z.getState().formStatusMapper,n=[...t];for(;n.length>0;){const s=n.shift();if(r[s.id]===!1)return!1;s.children&&n.push(...s.children)}return!0},setCategoryDefinition:t=>e({rootFormConfig:t.rootForm,unitFormConfig:t.unitForm,childFormConfig:t.childForm,searchFormConfig:t.searchForm,relationalFormConfig:t.relationalForm,publishChecklist:t.publishChecklist,reviewChecklist:t.reviewChecklist,rfcChecklist:t.rfcChecklist,categoryMeta:{schemaDefaults:t.schemaDefaults,frameworkMetadata:t.frameworkMetadata,sourcingSettings:t.sourcingSettings}})})),CC=Object.freeze(Object.defineProperty({__proto__:null,useEditorStore:Z},Symbol.toStringTag,{value:"Module"})),at=xo(e=>({activeModal:null,modalData:{},activeAssessmentSlot:null,activeLevelExamTarget:null,openModal:(t,r={})=>e({activeModal:t,modalData:r}),closeModal:()=>e({activeModal:null,modalData:{}}),setActiveAssessmentSlot:t=>e({activeAssessmentSlot:t,activeLevelExamTarget:null}),setActiveLevelExamTarget:t=>e({activeLevelExamTarget:t,activeAssessmentSlot:null})})),SC={emptyStateMessage:"Select a unit from the outline to edit its details",reviewCommentLabel:"Reviewer comment:",untitledPlaceholder:"Untitled",nodeTitleAriaLabel:"Node title",dropZoneLabel:"Drop to add content to this unit"},xC={ariaLabel:"Select language"},_C={errorBoundaryTitle:"Something went wrong",retryButton:"Retry",loadingMessage:"Loading editor...",loadErrorTitle:"Failed to load editor"},wC={nodePathAriaLabel:"Node path",homeAriaLabel:"Home"},TC={detailsTab:"Details",audienceCurriculumTab:"Audience & Curriculum",licensingTab:"Licensing",metadataSectionsAriaLabel:"Metadata sections",hasErrorsAriaLabel:"Has errors"},EC={moveToAnotherUnitButton:"Move to another unit",collapseMetadataPanelAriaLabel:"Collapse metadata panel",expandMetadataPanelAriaLabel:"Expand metadata panel",collapseTitle:"Collapse",expandTitle:"Expand",iconAlt:"icon",contentNamePlaceholder:"Content name",keywordsLabel:"Keywords",addKeywordPlaceholder:"Add keyword and press Enter",addButton:"Add",optionalInCollectionLabel:"Optional in Collection",yesOption:"Yes",noOption:"No"},kC={selectAppIconAriaLabel:"Select app icon",appIconAriaLabel:"App icon",appIconAlt:"App icon",removeIconAriaLabel:"Remove icon"},AC={removeConfirm:"Remove this content from the unit?",heading:"Content in this unit",emptyTitle:"No content yet",emptyHint:"Drag from the library or click Add content",addContentAriaLabel:"Add content to unit",addContent:"Add content"},LC={dragToReorderAriaLabel:"Drag to reorder",removeAriaLabel:"Remove {name}"},IC={invalidFileType:"Only .csv files are accepted.",fileTooLarge:"File size must not exceed 50 MB.",downloadSampleFailed:"Failed to download sample CSV.",processingFailed:"Upload processing failed. Please check the error rows below.",connectionLost:"Lost connection while checking status. Please try again.",uploadFailed:"Upload failed. Please check your file and try again.",statusUploading:"Uploading...",statusProcessing:"Processing...",statusDone:"Done!",statusError:"Error",titleUpdate:"Update Folder Metadata via CSV",titleCreate:"Create Folders via CSV",closeAriaLabel:"Close",dropZoneAriaLabel:"Drop CSV file here or click to browse",dropText:"Drag & drop your CSV here",dropSubtext:"or click to browse",downloadSample:"Download Sample CSV",itemsImportedSuffix:"— {count} item(s) imported",failedRowsTitle:"Failed Rows ({count})",rowHeader:"Row",nameHeader:"Name",reasonHeader:"Reason",unknownError:"Unknown error",cancel:"Cancel",uploaded:"Uploaded",upload:"Upload"},DC={saveFailed:"Failed to save collaborators. Please try again.",title:"Manage Collaborators",closeAriaLabel:"Close",searchUsersLabel:"Search users",searchPlaceholder:"Search by name or email...",searchingAriaLabel:"Searching...",searchResultsAriaLabel:"Search results",add:"Add",noUsersFound:"No users found.",currentCollaborators:"Current Collaborators",noCollaboratorsYet:"No collaborators added yet.",remove:"Remove",saveSuccess:"Collaborators saved successfully.",cancel:"Cancel",save:"Save"},jC={shuffleEnabledMessage:"Shuffling is enabled for this question set.",noFieldsMessage:"No fields configured for this tab.",skillFramework:"Skill framework",selectSkillFramework:"Select a skill framework",skills:"Skills",selectSkills:"Select skills",targetRole:"Target role (optional)",noTargetRole:"No target role"},OC={requiredError:"{field} is required",selectIconAriaLabel:"Select app icon",iconAlt:"App icon",selectIconLabel:"Select icon",removeIconAriaLabel:"Remove app icon",removeLabel:"Remove"},NC={dialogAriaLabel:"Select App Icon",title:"Select App Icon",closeAriaLabel:"Close",myImagesTab:"My Images",allImagesTab:"All Images",uploadTab:"Upload",searchPlaceholder:"Search images…",loadingText:"Loading…",noImagesFound:"No images found",noThumbnailText:"IMG",loadMoreButton:"Load More",previewAlt:"Preview",dropZoneText:"Drag & drop or click to browse",acceptedTypesInfo:"{types} · max {size} MB",cancelButton:"Cancel",uploadingText:"Uploading…",uploadAndUseButton:"Upload & Use",useSelectedButton:"Use Selected",invalidFileTypeError:"Only {types} files are accepted.",fileTooLargeError:"Image must be under {size} MB.",uploadFailedError:"Upload failed."},RC={addPlaceholder:"Add…",addButtonLabel:"Add"},PC={requiredError:"{field} is required"},FC={requiredError:"{field} is required",enterCodeMessage:"Enter a dial code to validate.",validMessage:"Dial code is valid.",notFoundMessage:"Dial code not found.",validationFailedMessage:"Validation failed. Please try again.",placeholderExample:"e.g. A1B2C3",validateAriaLabel:"Validate dial code",validatingLabel:"Validating…",validateButtonLabel:"Validate"},MC={requiredError:"{field} is required",inputPlaceholder:"Type and press Enter or comma…"},BC={requiredError:"{field} is required",selectPlaceholder:"Select license…"},qC={requiredError:"{field} is required",selectedCountSuffix:"selected",selectPlaceholder:"Select…",noOptionsMessage:"No options",searchPlaceholder:"Search…",noMatchesMessage:"No matches"},$C={requiredError:"{field} is required",selectPlaceholder:"Select…"},UC={requiredError:"{field} is required"},VC={requiredError:"{field} is required",selectPlaceholder:"Select…",noOptionsMessage:"No options",searchPlaceholder:"Search…",noMatchesMessage:"No matches"},HC={requiredError:"{field} is required",maxLengthError:"Max {max} characters"},zC={dialogAriaLabel:"Asset Browser",title:"Asset Browser",closeAriaLabel:"Close",browseTab:"Browse",uploadTab:"Upload",searchPlaceholder:"Search assets...",searchButton:"Search",loadingMessage:"Loading...",uploadingMessage:"Uploading...",chooseFileButton:"Choose file to upload"},QC={dialogAriaLabel:"Move resource",moveHeaderPrefix:"Move",closeAriaLabel:"Close",selectUnitHint:"Select a unit to move this content to:",noUnitsAvailable:"No other units available",cancelButton:"Cancel",moveButton:"Move here"},WC={dialogAriaLabel:"Assign Page Numbers",title:"Assign Page Numbers",closeAriaLabel:"Close",emptyState:"No content items found in this collection.",contentColumnHeader:"Content",pageNumberColumnHeader:"Page Number",cancelButton:"Cancel",saveButton:"Save"},GC={title:"Confirm deletion",confirmButton:"Confirm",cancelButton:"Cancel",closeAriaLabel:"Close"},KC={publishTitlePrefix:"Publish",closeAriaLabel:"Close",confirmPublishPrefix:"Are you sure you want to publish this",checklistInstructions:"Please confirm that ALL the following items are verified (by ticking the check-boxes) before you can publish:",selectAllLabel:"Select all",noButton:"No",yesButton:"Yes"},YC={reviewQualityTitle:"Review Quality",rejectContentTitle:"Reject Content",closeAriaLabel:"Close",qualityScoreLabel:"Quality Score",scorePoorLabel:"0 — Poor",scoreExcellentLabel:"10 — Excellent",commentLabel:"Comment",optionalLabel:"(optional)",commentPlaceholder:"Add any notes for the content creator…",rejectionReasonLabel:"Rejection Reason",rejectReasonPlaceholder:"Describe why this content is being rejected…",rejectionRequiredMessage:"A rejection reason is required.",cancelButton:"Cancel",approveButton:"Approve",rejectButton:"Reject"},ZC={title:"Unsaved changes",closeAriaLabel:"Close",bodyMessage:"You have unsaved changes. Would you like to save them before leaving?",cancelButton:"Cancel",discardButton:"Discard",saveButton:"Save"},XC={contentTypeFiltersAriaLabel:"Content type filters"},JC={alreadyAddedAriaLabel:"Already added",alreadyAddedTitle:"Already added to this collection",addItemAriaLabel:"Add {name} to unit",addToUnitTitle:"Add to unit",selectUnitToAddTitle:"Select a unit to add",draftOnlyTitle:"Only Draft content can be added",moreSkills:"+{count} more"},eS={selectUnitFirstToast:"Select a unit first",selectUnitFromOutlineToast:"Select a unit from the outline to add content — resources cannot be added directly to the course.",itemAlreadyAddedToast:'"{name}" is already in this collection',itemAddedToast:'Added "{name}"',collapseLibraryPanelAriaLabel:"Collapse library panel",collapseLibraryTitle:"Collapse library",cancelTargetAriaLabel:"Cancel — go back to browsing",headerTitle:"Library",searchPlaceholder:"Search content…",searchAriaLabel:"Search library",sortAZAriaLabel:"Sort: A–Z (click for Recent)",sortRecentAriaLabel:"Sort: Recent (click for A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recent",toggleAdvancedFiltersAriaLabel:"Toggle advanced filters",advancedFiltersTitle:"Advanced filters",libraryContentAriaLabel:"Library content",loadMoreAriaLabel:"Load more content",loadingText:"Loading…",loadMoreText:"Load More",noContentFound:"No content found",tryDifferentSearch:"Try a different search or filter",noSkillMatchTitle:"No content teaches this course's skills yet",noSkillMatchHint:"Content shows here once it is tagged only with this course's skills. Everything else is under Other content.",matchingHeading:"Teaches this course's skills",otherContentHeading:"Other content ({count})",otherContentHint:"These teach skills outside this course, or none. You can still add them.",pickSkillsHint:"Pick this course's skills to see the content that teaches them first."},tS={boardLabel:"Board",mediumLabel:"Medium",classLabel:"Class",subjectLabel:"Subject",primaryCategoryLabel:"Primary Category",filterLibraryAriaLabel:"Filter library",filtersHeaderTitle:"Filters",closeFiltersAriaLabel:"Close filters",resetButton:"Reset",applyButton:"Apply"},rS={contentPreviewAriaLabel:"Content preview",closePreviewAriaLabel:"Close preview",addToUnitButton:"+ Add to Unit"},nS={maxDepthReachedToast:"Maximum depth reached",downloadCsvFailedToast:"Failed to download CSV",outlineRefreshedToast:"Course outline refreshed.",outlineRefreshFailedToast:"Outline could not be refreshed automatically. Please reload the page.",moreOptionsAriaLabel:"More options",moreOptionsTitle:"More options",foldersExistTitle:'Folders already exist — use "Update" instead',createFoldersCsvButton:"Create folders using csv file",noFoldersYetTitle:'No folders yet — use "Create" first',downloadFoldersCsvButton:"Download folders as csv file",updateFoldersCsvButton:"Update folder metadata using csv file",expandOutlineAriaLabel:"Expand outline",collapseOutlineAriaLabel:"Collapse outline",addUnitButton:"Add Unit",addSubunitButton:"Add Sub-unit"},sS={expandAriaLabel:"Expand",collapseAriaLabel:"Collapse",dropHereLabel:"Drop here",nodeOptionsAriaLabel:"Node options",renameMenuItem:"Rename",addSubunitMenuItem:"Add sub-unit",addSiblingMenuItem:"Add Sibling",deleteMenuItem:"Delete"},oS={mimeLabelVideo:"Video",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Content",infoFieldAuthor:"Author",infoFieldLicense:"License",infoFieldLanguage:"Language",infoFieldClass:"Class",infoFieldSubject:"Subject",infoFieldType:"Type",loadingPreview:"Loading preview…",previewPlayerUnavailable:"Preview player unavailable. Check that /content/preview is reachable.",failedToInitializePlayer:"Failed to initialize the content player.",previewPlayerLoadFailed:"Preview player could not be loaded.",unableToLoadQuestionset:"Unable to load questionset:",parentQuestionsetNotResolved:"Could not resolve the parent questionset for this question.",questionNotFoundInQuestionset:"Question not found in the questionset."},aS={title:"QR Code (Dialcode)",invalidFormatError:"Invalid DIAL code format. Use uppercase letters and digits only (e.g. A1B2C3).",duplicateDialcodeError:'DIAL code "{code}" is already linked to another node in this collection.',dialcodeNotFoundError:"Dialcode not found. Please enter a valid code.",linkFailedError:"Failed to link dialcode. Please try again.",unlinkFailedError:"Failed to remove dialcode. Please try again.",qrCodeAltPrefix:"QR code for",linkedCodeLabel:"Linked code:",removeButton:"Remove",noCodeLinkedMessage:"No QR code linked to this content.",linkManuallyLabel:"Link manually",dialcodeInputPlaceholder:"Enter dialcode (e.g. A1B2C3)",dialcodeInputAriaLabel:"Dialcode input",linkButton:"Link",linkedSuccessMessage:"Dialcode linked successfully."},iS={unitsAddedLabel:"Units added",contentItemsLabel:"Content items",progressLabel:"Progress"},lS={dropOntoUnitError:"Drop onto a unit to add content",dropOntoCourseError:"Drop content onto a unit, not directly on the course.",alreadyInCollectionError:'"{name}" is already in this collection',addedToUnitSuccess:'Added "{name}" to unit',fillRequiredMetadataError:"Please fill the required metadata",outlineAriaLabel:"Course outline",showOutlineTitle:"Show outline",editorAriaLabel:"Content editor",libraryAriaLabel:"Content library",showLibraryTitle:"Show library"},cS={draftStatusFallback:"Draft",backAriaLabel:"Go back",statusAriaLabelPrefix:"Status:",savingIndicator:"Saving…",unsavedIndicator:"Unsaved",savedIndicatorPrefix:"Saved",fillRequiredFieldsTooltip:"Fill all required fields before saving",saveAsDraftButton:"Save as Draft",sendForReviewButton:"Send for review",collaboratorsLabel:"Collaborators",qrCodesLabel:"QR Codes",generatingEllipsis:"Generating…",generateQrCodesMenuItem:"Generate QR Codes",downloadingEllipsis:"Downloading…",downloadQrCodesMenuItem:"Download QR Codes",publishButton:"Publish",requestForChangesButton:"Request for Changes",approveButton:"Approve",qrGenerationStartedToast:'QR Codes generation started. Use "Download QR Codes" once ready.',qrGenerationFailedToast:"Failed to generate QR Codes. Please try again.",qrCodesNotGeneratedToast:"No QR codes generated yet. Generate QR Codes first.",qrGenerationInProgressToast:"QR code image generation is in progress. Please try downloading after some time.",qrCodesNotReadyToast:"QR Codes not ready yet. Please wait and try again.",qrCodesDownloadedToast:"QR codes downloaded.",qrCodesDownloadFailedToast:"Failed to download QR Codes.",requestChangesTitle:"Request Changes",changesRequestedLabel:"Changes requested",describeChangesPlaceholder:"Describe the changes the author needs to make"},uS={closeAriaLabel:"Close",fillCommentsError:"Fill comments",cancelButton:"Cancel"},dS={closeAriaLabel:"Close",title:"Accepting Terms & Conditions",agreementTextPart1:"I agree that by submitting / publishing this Content, I confirm that this Content complies with prescribed guidelines, including the Terms of Use and Content Policy and that I consent to publish it under the",creativeCommonsLinkText:"Creative Commons Framework",agreementTextPart2:"in accordance with the",contentPolicyText:"Content Policy",agreementTextPart3:". I have made sure that I do not violate others' copyright or privacy rights.",cancelButton:"Cancel",submitButton:"Submit"},fS={closeAriaLabel:"Close",title:"Generate QR Codes",numberOfCodesLabel:"Number of QR Codes",countPlaceholder:"Enter number (2–250)",countRangeError:"Enter a number between 2 and 250.",cancelButton:"Cancel",generateButton:"Generate"},hS={remove:"Remove"},pS={dropHere:"Drop here"},mS={loading:"Loading"},gS={profileBadgeLabel:"Learning Path",pathStructureLabel:"Path Structure",addLevelButton:"Add Level",levelNumberPrefix:"Level {n}",priorAssessmentLabel:"Prior Assessment",priorAssessmentHint:"Always required · not a level",outcomeAssessmentLabel:"Outcome Assessment",outcomeAssessmentHint:"Confirms outcome · not a level",skillCheckBadge:"Skill check",outcomeCheckBadge:"Outcome check",assessmentCourseMeta:"Course · Question set only",addAssessmentSlotButton:"Add {label} — a course with only a question set",requiredSlotBadge:"Required",removeAssessmentSlotButton:"Remove",addCourseToLevelButton:"Add a course from the Library",addLevelExamButton:"Add Level Exam — a course with only a question set",levelExamMeta:"Level Exam · Question set only",deletePriorAssessmentConfirm:"Deleting the Prior Assessment removes the score this path's Adaptive skips are based on. Continue?",deleteAssessmentSlotConfirm:"Remove this assessment course from the path?",deleteLevelExamConfirm:"Remove this Level Exam course from the level?",deleteLevelConfirm:'Delete "{name}" and everything in it?',deleteCourseConfirm:"Remove this course from the path?",deleteMultipleConfirm:"Delete {count} selected items from the path?",courseNameUnavailable:"Course details unavailable",notAssessmentCourseToast:`"{name}" isn't an Evaluation Course, so it can't be used as an assessment.`,bothSlotsFilledToast:"Both Prior and Outcome Assessment slots are already filled.",levelExamAlreadyFilledToast:"This level already has a Level Exam course — remove it before adding a different one.",assessmentCheckFailedToast:"Could not verify this course. Please try again.",skillsHeading:"Skills this level builds",skillsCoveredHeading:"Skills learners earn from this path",skillsCoveredDescription:"Learners get these skills when they finish the path. Made up of the skills taught by the courses on each level, plus the Prior and Outcome Assessments.",noSkillsYet:"No skills yet — add courses tagged with skills to the levels to see them here.",levelCountLabel:"{count} level",levelCountLabelPlural:"{count} levels",courseCountLabel:"{count} course",courseCountLabelPlural:"{count} courses",backToPathButton:"Back to path",backToLevelButton:"Back to {label}",courseDetailsLoading:"Loading course details…",courseDetailsEmpty:"This course has no units yet.",courseDetailsError:"Could not load course details.",courseDetailsCardTitle:"Course details",courseTitleFieldLabel:"Title",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"No description available.",unitsSectionLabel:"Units",unitsSectionDescription:"Units group related content; each content item is tagged with the skills it builds.",unitTopicsFieldLabel:"Topics",contentCountLabel:"{count} content",contentCountLabelPlural:"{count} contents",courseUnitTopicsLabel:"{count} topic",courseUnitTopicsLabelPlural:"{count} topics",verifyingAssessmentCourses:"Verifying assessment courses…",resolveBeforePublishing:"Resolve these before publishing:",resolveBeforeSendingForReview:"Resolve these before sending for review:",assessmentsCardHeading:"Prior & outcome assessments",assessmentsCardDescription:"Add the question-set-only courses that open and close this path.",assessmentNotAddedYet:"Not added yet — pick a question-set-only course from the Library.",viewCourseMenuItem:"View",priorAssessmentExplainerTitle:"Why this can't be skipped",priorAssessmentExplainerBody:"This question set's score is what every level reads to decide a skip — there's nothing to compare against yet, so it always runs in full.",priorAssessmentPurposeLabel:"Sets the skill baseline",outcomeAssessmentExplainerTitle:"Closes the path",outcomeAssessmentExplainerBody:"Passing this question set is what certifies the skill gain for the whole path — its score is what appears on the learner's certificate.",outcomeUnlocksHint:"Unlocks after the last level",assessmentCourseSectionTitle:"Course",assessmentCourseSectionDescription:"A single Evaluation Course — its content can only be Question Sets or Course Assessment, never other content types.",libraryOpenLevelToAdd:"Open a level to add",libraryAddToLevel:"Add to {level}",libraryAddPriorAssessmentCourse:"Add Prior Assessment course",libraryAddOutcomeAssessmentCourse:"Add Outcome Assessment course",libraryAddLevelExamCourse:"Add Level Exam course for {level}",policyStrictLabel:"Strict",policyStrictDescription:"Every learner completes every level, in order — regardless of prior assessment score.",policyAdaptiveLabel:"Adaptive",policyAdaptiveDescriptionPre:"A level can be skipped, but only when the learner's score on the Prior Assessment",policyAdaptiveDescriptionPost:" clears its waiver threshold.",policyPriorLearningLabel:"Prior learning",policyPriorLearningDescription:"Skips can also draw on skills the learner already holds — a verified certificate or prior course — not the assessment alone.",selectLevelFirstToast:"Select a level first",selectLevelFromOutlineToast:"Open a level in the path structure to add courses — courses cannot be added to the path itself or under another course.",selectCurriculumFirstToast:"Select a Curriculum or a skill framework for this path before adding courses.",noCurriculumEmptyTitle:"No Curriculum or skill framework selected",noCurriculumEmptyHint:"Select a Curriculum or a skill framework for this path to browse courses.",itemAlreadyInPathToast:'"{name}" is already in this learning path',addedToLevelSuccess:'Added "{name}" to level',dropOntoLevelError:"Drop onto a level to add a course",dropOntoPathError:"Drop courses onto a level, not directly on the learning path.",priorSlotFilledToast:"The Prior Assessment already has a course — remove it before adding a different one.",outcomeSlotFilledToast:"The Outcome Assessment already has a course — remove it before adding a different one.",levelNeedsMixedContentToast:"This level is first or last in the path — a question-set-only course as its only content will be treated as a Prior/Outcome Assessment. Add another course, or one with more than just question sets.",cannotRemoveLastRegularCourseToast:"This level is first or last in the path — removing this course would leave only the Level Exam course, and it would be treated as a Prior/Outcome Assessment. Add another course first.",coursesRemovedFrameworkChangeToast:"{count} course(s) tagged to a different curriculum were removed from this path.",levelSkillsResetFrameworkChangeToast:"{count} Level(s) had their selected skills cleared — they don't apply to the new curriculum.",priorAssessmentNarrowedScopeToast:"The Prior Assessment narrowed the skill scope — {count} Level(s) now have skills outside it.",coursesCardHeading:"Courses",coursesCardDescription:"Courses a learner completes to clear this level. Drag the handle to reorder, use the menu to remove.",coursesEmptyHint:"No courses yet.",courseMetaLabel:"Course",removeFromLevelMenuItem:"Remove from level",courseNotTeachingRoleBadge:"Teaches skills outside this role",roleChangedCoursesFlaggedToast:"{count} course(s) teach skills outside the new role. They're kept and flagged — remove them before sending for review.",priorAssessmentMissingRoleSkills:"The Prior Assessment doesn't test these role skills: {skills}",skillFrameworkChangedToast:"Skill framework changed: the target role and the path's skills were cleared.",roleSkillsCoveredDescription:"The target role's skills. Learners get them when they finish the path. Every one must be taught by a course before the path can be sent for review.",roleSkillNotTaughtSuffix:"not taught yet",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"No course in this path teaches this skill yet",roleSkillTaughtTitle:"A course in this path teaches this skill",levelSkillsFromCoursesNote:"Worked out from the courses in this level. Add or remove courses to change them.",levelSkillsEmpty:"No skills yet — add a course to this level.",levelSkillsOutsidePrior:"These skills aren't tested by the Prior Assessment: {skills}. Remove the course that teaches them."},fl={contextualEditor:SC,languageSelector:xC,collectionEditor:_C,breadcrumb:wC,tabBar:TC,contentEditForm:EC,titleAppIcon:kC,unitContentList:AC,contentRow:LC,csvUpload:IC,manageCollaborators:DC,sparkMetaForm:jC,appIconField:OC,appIconPickerModal:NC,chipGroupField:RC,dateTimeField:PC,dialcodeInputField:FC,keywordSuggestField:MC,licenseSelectField:BC,multiSelectField:qC,nestedSelectField:$C,radioField:UC,selectField:VC,textField:HC,assetBrowser:zC,resourceReorderDialog:QC,assignPageNumber:WC,confirmDialog:GC,publishChecklist:KC,qualityParamsModal:YC,unsavedChangesModal:ZC,filterChips:XC,libraryCard:JC,libraryDock:eS,libraryFilterPanel:tS,libraryPreviewPanel:rS,outlineTree:nS,treeNode:sS,contentPlayer:oS,dialcodePanel:aS,progressStatus:iS,splitBuilderShell:lS,topbar:cS,reviewCommentModal:uS,confirmReviewModal:dS,generateQRModal:fS,chip:hS,dropZone:pS,spinner:mS,learningPath:gS},vS={emptyStateMessage:"اختر وحدة من المخطط التفصيلي لتحرير تفاصيلها",reviewCommentLabel:"تعليق المراجع:",untitledPlaceholder:"بدون عنوان",nodeTitleAriaLabel:"عنوان العنصر",dropZoneLabel:"أفلت هنا لإضافة محتوى إلى هذه الوحدة"},yS={ariaLabel:"اختيار اللغة"},bS={errorBoundaryTitle:"حدث خطأ ما",retryButton:"إعادة المحاولة",loadingMessage:"جارٍ تحميل المحرر...",loadErrorTitle:"فشل تحميل المحرر"},CS={nodePathAriaLabel:"مسار العنصر",homeAriaLabel:"الصفحة الرئيسية"},SS={detailsTab:"التفاصيل",audienceCurriculumTab:"الجمهور والمنهج",licensingTab:"الترخيص",metadataSectionsAriaLabel:"أقسام البيانات الوصفية",hasErrorsAriaLabel:"يحتوي على أخطاء"},xS={moveToAnotherUnitButton:"نقل إلى وحدة أخرى",collapseMetadataPanelAriaLabel:"طي لوحة البيانات الوصفية",expandMetadataPanelAriaLabel:"توسيع لوحة البيانات الوصفية",collapseTitle:"طي",expandTitle:"توسيع",iconAlt:"أيقونة",contentNamePlaceholder:"اسم المحتوى",keywordsLabel:"الكلمات المفتاحية",addKeywordPlaceholder:"أضف كلمة مفتاحية واضغط Enter",addButton:"إضافة",optionalInCollectionLabel:"اختياري في المجموعة",yesOption:"نعم",noOption:"لا"},_S={selectAppIconAriaLabel:"اختيار أيقونة التطبيق",appIconAriaLabel:"أيقونة التطبيق",appIconAlt:"أيقونة التطبيق",removeIconAriaLabel:"إزالة الأيقونة"},wS={removeConfirm:"هل تريد إزالة هذا المحتوى من الوحدة؟",heading:"المحتوى في هذه الوحدة",emptyTitle:"لا يوجد محتوى بعد",emptyHint:"اسحب من المكتبة أو انقر فوق إضافة محتوى",addContentAriaLabel:"إضافة محتوى إلى الوحدة",addContent:"إضافة محتوى"},TS={dragToReorderAriaLabel:"اسحب لإعادة الترتيب",removeAriaLabel:"إزالة {name}"},ES={invalidFileType:"يُقبل فقط ملفات .csv.",fileTooLarge:"يجب ألا يتجاوز حجم الملف 50 ميجابايت.",downloadSampleFailed:"فشل تنزيل نموذج ملف CSV.",processingFailed:"فشلت معالجة التحميل. يرجى التحقق من صفوف الأخطاء أدناه.",connectionLost:"انقطع الاتصال أثناء التحقق من الحالة. يرجى المحاولة مرة أخرى.",uploadFailed:"فشل التحميل. يرجى التحقق من الملف والمحاولة مرة أخرى.",statusUploading:"جارٍ التحميل...",statusProcessing:"جارٍ المعالجة...",statusDone:"تم!",statusError:"خطأ",titleUpdate:"تحديث بيانات المجلدات الوصفية عبر CSV",titleCreate:"إنشاء مجلدات عبر CSV",closeAriaLabel:"إغلاق",dropZoneAriaLabel:"أفلت ملف CSV هنا أو انقر للتصفح",dropText:"اسحب وأفلت ملف CSV هنا",dropSubtext:"أو انقر للتصفح",downloadSample:"تنزيل نموذج CSV",itemsImportedSuffix:"— تم استيراد {count} عنصر (عناصر)",failedRowsTitle:"الصفوف الفاشلة ({count})",rowHeader:"الصف",nameHeader:"الاسم",reasonHeader:"السبب",unknownError:"خطأ غير معروف",cancel:"إلغاء",uploaded:"تم التحميل",upload:"تحميل"},kS={saveFailed:"فشل حفظ المتعاونين. يرجى المحاولة مرة أخرى.",title:"إدارة المتعاونين",closeAriaLabel:"إغلاق",searchUsersLabel:"البحث عن المستخدمين",searchPlaceholder:"البحث بالاسم أو البريد الإلكتروني...",searchingAriaLabel:"جارٍ البحث...",searchResultsAriaLabel:"نتائج البحث",add:"إضافة",noUsersFound:"لم يتم العثور على مستخدمين.",currentCollaborators:"المتعاونون الحاليون",noCollaboratorsYet:"لم تتم إضافة أي متعاونين بعد.",remove:"إزالة",saveSuccess:"تم حفظ المتعاونين بنجاح.",cancel:"إلغاء",save:"حفظ"},AS={shuffleEnabledMessage:"تم تفعيل الترتيب العشوائي لهذه المجموعة من الأسئلة.",noFieldsMessage:"لا توجد حقول مُهيَّأة لهذا التبويب.",skillFramework:"إطار المهارات",selectSkillFramework:"اختر إطار مهارات",skills:"المهارات",selectSkills:"اختر المهارات",targetRole:"الدور المستهدف (اختياري)",noTargetRole:"بدون دور مستهدف"},LS={requiredError:"{field} مطلوب",selectIconAriaLabel:"اختيار أيقونة التطبيق",iconAlt:"أيقونة التطبيق",selectIconLabel:"اختيار أيقونة",removeIconAriaLabel:"إزالة أيقونة التطبيق",removeLabel:"إزالة"},IS={dialogAriaLabel:"اختيار أيقونة التطبيق",title:"اختيار أيقونة التطبيق",closeAriaLabel:"إغلاق",myImagesTab:"صوري",allImagesTab:"جميع الصور",uploadTab:"تحميل",searchPlaceholder:"البحث في الصور…",loadingText:"جارٍ التحميل…",noImagesFound:"لم يتم العثور على صور",noThumbnailText:"صورة",loadMoreButton:"تحميل المزيد",previewAlt:"معاينة",dropZoneText:"اسحب وأفلت أو انقر للتصفح",acceptedTypesInfo:"{types} · بحد أقصى {size} ميجابايت",cancelButton:"إلغاء",uploadingText:"جارٍ التحميل…",uploadAndUseButton:"تحميل واستخدام",useSelectedButton:"استخدام المحدد",invalidFileTypeError:"يُقبل فقط ملفات {types}.",fileTooLargeError:"يجب أن يكون حجم الصورة أقل من {size} ميجابايت.",uploadFailedError:"فشل التحميل."},DS={addPlaceholder:"إضافة…",addButtonLabel:"إضافة"},jS={requiredError:"{field} مطلوب"},OS={requiredError:"{field} مطلوب",enterCodeMessage:"أدخل رمز الطلب للتحقق منه.",validMessage:"رمز الطلب صالح.",notFoundMessage:"رمز الطلب غير موجود.",validationFailedMessage:"فشل التحقق. يرجى المحاولة مرة أخرى.",placeholderExample:"مثال: A1B2C3",validateAriaLabel:"التحقق من رمز الطلب",validatingLabel:"جارٍ التحقق…",validateButtonLabel:"تحقق"},NS={requiredError:"{field} مطلوب",inputPlaceholder:"اكتب واضغط Enter أو فاصلة…"},RS={requiredError:"{field} مطلوب",selectPlaceholder:"اختر ترخيصًا…"},PS={requiredError:"{field} مطلوب",selectedCountSuffix:"محدد",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات",searchPlaceholder:"بحث…",noMatchesMessage:"لا توجد نتائج"},FS={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…"},MS={requiredError:"{field} مطلوب"},BS={requiredError:"{field} مطلوب",selectPlaceholder:"اختر…",noOptionsMessage:"لا توجد خيارات",searchPlaceholder:"بحث…",noMatchesMessage:"لا توجد نتائج"},qS={requiredError:"{field} مطلوب",maxLengthError:"الحد الأقصى {max} حرفًا"},$S={dialogAriaLabel:"متصفح الأصول",title:"متصفح الأصول",closeAriaLabel:"إغلاق",browseTab:"تصفح",uploadTab:"تحميل",searchPlaceholder:"البحث في الأصول...",searchButton:"بحث",loadingMessage:"جارٍ التحميل...",uploadingMessage:"جارٍ التحميل...",chooseFileButton:"اختر ملفًا للتحميل"},US={dialogAriaLabel:"نقل المورد",moveHeaderPrefix:"نقل",closeAriaLabel:"إغلاق",selectUnitHint:"اختر وحدة لنقل هذا المحتوى إليها:",noUnitsAvailable:"لا توجد وحدات أخرى متاحة",cancelButton:"إلغاء",moveButton:"نقل إلى هنا"},VS={dialogAriaLabel:"تعيين أرقام الصفحات",title:"تعيين أرقام الصفحات",closeAriaLabel:"إغلاق",emptyState:"لم يتم العثور على عناصر محتوى في هذه المجموعة.",contentColumnHeader:"المحتوى",pageNumberColumnHeader:"رقم الصفحة",cancelButton:"إلغاء",saveButton:"حفظ"},HS={title:"تأكيد الحذف",confirmButton:"تأكيد",cancelButton:"إلغاء",closeAriaLabel:"إغلاق"},zS={publishTitlePrefix:"نشر",closeAriaLabel:"إغلاق",confirmPublishPrefix:"هل أنت متأكد من رغبتك في نشر هذا",checklistInstructions:"يرجى تأكيد التحقق من جميع العناصر التالية (بتحديد مربعات الاختيار) قبل أن تتمكن من النشر:",selectAllLabel:"تحديد الكل",noButton:"لا",yesButton:"نعم"},QS={reviewQualityTitle:"مراجعة الجودة",rejectContentTitle:"رفض المحتوى",closeAriaLabel:"إغلاق",qualityScoreLabel:"درجة الجودة",scorePoorLabel:"0 — ضعيف",scoreExcellentLabel:"10 — ممتاز",commentLabel:"تعليق",optionalLabel:"(اختياري)",commentPlaceholder:"أضف أي ملاحظات لمنشئ المحتوى…",rejectionReasonLabel:"سبب الرفض",rejectReasonPlaceholder:"اذكر سبب رفض هذا المحتوى…",rejectionRequiredMessage:"سبب الرفض مطلوب.",cancelButton:"إلغاء",approveButton:"قبول",rejectButton:"رفض"},WS={title:"تغييرات غير محفوظة",closeAriaLabel:"إغلاق",bodyMessage:"لديك تغييرات غير محفوظة. هل تريد حفظها قبل المغادرة؟",cancelButton:"إلغاء",discardButton:"تجاهل",saveButton:"حفظ"},GS={contentTypeFiltersAriaLabel:"مرشحات نوع المحتوى"},KS={alreadyAddedAriaLabel:"تمت إضافته مسبقًا",alreadyAddedTitle:"تمت إضافته مسبقًا إلى هذه المجموعة",addItemAriaLabel:"إضافة {name} إلى الوحدة",addToUnitTitle:"إضافة إلى الوحدة",selectUnitToAddTitle:"اختر وحدة للإضافة إليها",draftOnlyTitle:"يمكن إضافة المحتوى المسودة فقط",moreSkills:"+{count} أخرى"},YS={selectUnitFirstToast:"اختر وحدة أولاً",selectUnitFromOutlineToast:"اختر وحدة من المخطط التفصيلي لإضافة محتوى — لا يمكن إضافة الموارد مباشرة إلى الدورة.",itemAlreadyAddedToast:'"{name}" موجود مسبقًا في هذه المجموعة',itemAddedToast:'تمت إضافة "{name}"',collapseLibraryPanelAriaLabel:"طي لوحة المكتبة",collapseLibraryTitle:"طي المكتبة",cancelTargetAriaLabel:"إلغاء — العودة إلى التصفح",headerTitle:"المكتبة",searchPlaceholder:"البحث في المحتوى…",searchAriaLabel:"البحث في المكتبة",sortAZAriaLabel:"الترتيب: أ–ي (انقر للأحدث)",sortRecentAriaLabel:"الترتيب: الأحدث (انقر لـ أ–ي)",sortAZTitle:"أ–ي",sortRecentTitle:"الأحدث",toggleAdvancedFiltersAriaLabel:"تبديل المرشحات المتقدمة",advancedFiltersTitle:"المرشحات المتقدمة",libraryContentAriaLabel:"محتوى المكتبة",loadMoreAriaLabel:"تحميل المزيد من المحتوى",loadingText:"جارٍ التحميل…",loadMoreText:"تحميل المزيد",noContentFound:"لم يتم العثور على محتوى",tryDifferentSearch:"جرّب بحثًا أو مرشحًا مختلفًا",noSkillMatchTitle:"لا يوجد محتوى يُدرّس مهارات هذه الدورة بعد",noSkillMatchHint:"يظهر المحتوى هنا عندما يُوسم بمهارات هذه الدورة فقط. وكل ما عدا ذلك موجود ضمن محتوى آخر.",matchingHeading:"يُدرّس مهارات هذه الدورة",otherContentHeading:"محتوى آخر ({count})",otherContentHint:"هذا المحتوى يُدرّس مهارات خارج هذه الدورة، أو لا يُدرّس أي مهارة. لا يزال بإمكانك إضافته.",pickSkillsHint:"اختر مهارات هذه الدورة لترى أولًا المحتوى الذي يُدرّسها."},ZS={boardLabel:"المجلس التعليمي",mediumLabel:"لغة التدريس",classLabel:"الصف",subjectLabel:"المادة",primaryCategoryLabel:"الفئة الأساسية",filterLibraryAriaLabel:"تصفية المكتبة",filtersHeaderTitle:"المرشحات",closeFiltersAriaLabel:"إغلاق المرشحات",resetButton:"إعادة تعيين",applyButton:"تطبيق"},XS={contentPreviewAriaLabel:"معاينة المحتوى",closePreviewAriaLabel:"إغلاق المعاينة",addToUnitButton:"+ إضافة إلى الوحدة"},JS={maxDepthReachedToast:"تم الوصول إلى الحد الأقصى للعمق",downloadCsvFailedToast:"فشل تنزيل ملف CSV",outlineRefreshedToast:"تم تحديث مخطط الدورة.",outlineRefreshFailedToast:"تعذّر تحديث المخطط التفصيلي تلقائيًا. يرجى إعادة تحميل الصفحة.",moreOptionsAriaLabel:"خيارات إضافية",moreOptionsTitle:"خيارات إضافية",foldersExistTitle:'المجلدات موجودة مسبقًا — استخدم "تحديث" بدلاً من ذلك',createFoldersCsvButton:"إنشاء مجلدات باستخدام ملف csv",noFoldersYetTitle:'لا توجد مجلدات بعد — استخدم "إنشاء" أولاً',downloadFoldersCsvButton:"تنزيل المجلدات كملف csv",updateFoldersCsvButton:"تحديث بيانات المجلدات الوصفية باستخدام ملف csv",expandOutlineAriaLabel:"توسيع المخطط التفصيلي",collapseOutlineAriaLabel:"طي المخطط التفصيلي",addUnitButton:"إضافة وحدة",addSubunitButton:"إضافة وحدة فرعية"},ex={expandAriaLabel:"توسيع",collapseAriaLabel:"طي",dropHereLabel:"أفلت هنا",nodeOptionsAriaLabel:"خيارات العنصر",renameMenuItem:"إعادة تسمية",addSubunitMenuItem:"إضافة وحدة فرعية",addSiblingMenuItem:"إضافة عنصر مماثل",deleteMenuItem:"حذف"},tx={mimeLabelVideo:"فيديو",mimeLabelAudio:"صوت",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"محتوى",infoFieldAuthor:"المؤلف",infoFieldLicense:"الترخيص",infoFieldLanguage:"اللغة",infoFieldClass:"الصف",infoFieldSubject:"المادة",infoFieldType:"النوع",loadingPreview:"جارٍ تحميل المعاينة…",previewPlayerUnavailable:"مشغّل المعاينة غير متاح. تحقق من إمكانية الوصول إلى /content/preview.",failedToInitializePlayer:"فشل تهيئة مشغّل المحتوى.",previewPlayerLoadFailed:"تعذّر تحميل مشغّل المعاينة.",unableToLoadQuestionset:"تعذّر تحميل مجموعة الأسئلة:",parentQuestionsetNotResolved:"تعذّر تحديد مجموعة الأسئلة الرئيسية لهذا السؤال.",questionNotFoundInQuestionset:"لم يتم العثور على السؤال في مجموعة الأسئلة."},rx={title:"رمز الاستجابة السريعة (رمز الطلب)",invalidFormatError:"تنسيق رمز DIAL غير صالح. استخدم الأحرف الكبيرة والأرقام فقط (مثال: A1B2C3).",duplicateDialcodeError:'رمز DIAL "{code}" مرتبط مسبقًا بعنصر آخر في هذه المجموعة.',dialcodeNotFoundError:"رمز الطلب غير موجود. يرجى إدخال رمز صالح.",linkFailedError:"فشل ربط رمز الطلب. يرجى المحاولة مرة أخرى.",unlinkFailedError:"فشلت إزالة رمز الطلب. يرجى المحاولة مرة أخرى.",qrCodeAltPrefix:"رمز الاستجابة السريعة لـ",linkedCodeLabel:"الرمز المرتبط:",removeButton:"إزالة",noCodeLinkedMessage:"لا يوجد رمز استجابة سريعة مرتبط بهذا المحتوى.",linkManuallyLabel:"الربط يدويًا",dialcodeInputPlaceholder:"أدخل رمز الطلب (مثال: A1B2C3)",dialcodeInputAriaLabel:"إدخال رمز الطلب",linkButton:"ربط",linkedSuccessMessage:"تم ربط رمز الطلب بنجاح."},nx={unitsAddedLabel:"الوحدات المضافة",contentItemsLabel:"عناصر المحتوى",progressLabel:"التقدّم"},sx={dropOntoUnitError:"أفلت على وحدة لإضافة محتوى",dropOntoCourseError:"أفلت المحتوى على وحدة، وليس مباشرة على الدورة.",alreadyInCollectionError:'"{name}" موجود مسبقًا في هذه المجموعة',addedToUnitSuccess:'تمت إضافة "{name}" إلى الوحدة',fillRequiredMetadataError:"يرجى تعبئة البيانات الوصفية المطلوبة",outlineAriaLabel:"مخطط الدورة",showOutlineTitle:"إظهار المخطط التفصيلي",editorAriaLabel:"محرر المحتوى",libraryAriaLabel:"مكتبة المحتوى",showLibraryTitle:"إظهار المكتبة"},ox={draftStatusFallback:"مسودة",backAriaLabel:"رجوع",statusAriaLabelPrefix:"الحالة:",savingIndicator:"جارٍ الحفظ…",unsavedIndicator:"غير محفوظ",savedIndicatorPrefix:"تم الحفظ",fillRequiredFieldsTooltip:"عبّئ جميع الحقول المطلوبة قبل الحفظ",saveAsDraftButton:"حفظ كمسودة",sendForReviewButton:"إرسال للمراجعة",collaboratorsLabel:"المتعاونون",qrCodesLabel:"رموز الاستجابة السريعة",generatingEllipsis:"جارٍ الإنشاء…",generateQrCodesMenuItem:"إنشاء رموز استجابة سريعة",downloadingEllipsis:"جارٍ التنزيل…",downloadQrCodesMenuItem:"تنزيل رموز الاستجابة السريعة",publishButton:"نشر",requestForChangesButton:"طلب إجراء تغييرات",approveButton:"قبول",qrGenerationStartedToast:'بدأ إنشاء رموز الاستجابة السريعة. استخدم "تنزيل رموز الاستجابة السريعة" عند الجهوز.',qrGenerationFailedToast:"فشل إنشاء رموز الاستجابة السريعة. يرجى المحاولة مرة أخرى.",qrCodesNotGeneratedToast:"لم يتم إنشاء أي رموز استجابة سريعة بعد. قم بإنشاء رموز الاستجابة السريعة أولاً.",qrGenerationInProgressToast:"إنشاء صور رموز الاستجابة السريعة قيد التنفيذ. يرجى المحاولة بالتنزيل بعد قليل.",qrCodesNotReadyToast:"رموز الاستجابة السريعة ليست جاهزة بعد. يرجى الانتظار والمحاولة مرة أخرى.",qrCodesDownloadedToast:"تم تنزيل رموز الاستجابة السريعة.",qrCodesDownloadFailedToast:"فشل تنزيل رموز الاستجابة السريعة.",requestChangesTitle:"طلب إجراء تغييرات",changesRequestedLabel:"تم طلب تغييرات",describeChangesPlaceholder:"اذكر التغييرات التي يجب على المؤلف إجراؤها"},ax={closeAriaLabel:"إغلاق",fillCommentsError:"أضف تعليقات",cancelButton:"إلغاء"},ix={closeAriaLabel:"إغلاق",title:"قبول الشروط والأحكام",agreementTextPart1:"أوافق على أنه بإرسال / نشر هذا المحتوى، فإنني أؤكد أن هذا المحتوى يتوافق مع الإرشادات المعتمدة، بما في ذلك شروط الاستخدام وسياسة المحتوى، وأني أوافق على نشره بموجب",creativeCommonsLinkText:"إطار عمل Creative Commons",agreementTextPart2:"وفقًا لـ",contentPolicyText:"سياسة المحتوى",agreementTextPart3:". وقد تحققت من أنني لا أنتهك حقوق النشر أو الخصوصية الخاصة بالآخرين.",cancelButton:"إلغاء",submitButton:"إرسال"},lx={closeAriaLabel:"إغلاق",title:"إنشاء رموز الاستجابة السريعة",numberOfCodesLabel:"عدد رموز الاستجابة السريعة",countPlaceholder:"أدخل رقمًا (2–250)",countRangeError:"أدخل رقمًا بين 2 و 250.",cancelButton:"إلغاء",generateButton:"إنشاء"},cx={remove:"إزالة"},ux={dropHere:"أفلت هنا"},dx={loading:"جارٍ التحميل"},fx={profileBadgeLabel:"مسار التعلم",pathStructureLabel:"بنية المسار",addLevelButton:"إضافة مستوى",levelNumberPrefix:"المستوى {n}",priorAssessmentLabel:"التقييم المسبق",priorAssessmentHint:"مطلوب دائمًا · لا يُحسب كمستوى",outcomeAssessmentLabel:"تقييم النتائج",outcomeAssessmentHint:"يؤكد النتيجة · لا يُحسب كمستوى",skillCheckBadge:"فحص المهارة",outcomeCheckBadge:"فحص النتيجة",assessmentCourseMeta:"مقرر · بنك أسئلة فقط",addAssessmentSlotButton:"إضافة {label} — مقرر يحتوي على بنك أسئلة فقط",addCourseToLevelButton:"أضف دورة من المكتبة",addLevelExamButton:"إضافة اختبار المستوى — مقرر يحتوي على بنك أسئلة فقط",levelExamMeta:"اختبار المستوى · بنك أسئلة فقط",requiredSlotBadge:"مطلوب",removeAssessmentSlotButton:"إزالة",deletePriorAssessmentConfirm:"حذف التقييم المسبق يزيل الدرجة التي يعتمد عليها التخطي التكيفي لهذا المسار. هل تريد الاستمرار؟",deleteAssessmentSlotConfirm:"هل تريد إزالة مقرر التقييم هذا من المسار؟",deleteLevelExamConfirm:"هل تريد إزالة مقرر اختبار المستوى هذا من المستوى؟",deleteLevelConfirm:'هل تريد حذف "{name}" وكل ما يحتويه؟',deleteCourseConfirm:"هل تريد إزالة هذا المقرر من المسار؟",deleteMultipleConfirm:"هل تريد حذف {count} من العناصر المحددة من المسار؟",courseNameUnavailable:"تفاصيل المقرر غير متوفرة",notAssessmentCourseToast:'"{name}" ليس مقرر تقييم (Evaluation Course)، لذا لا يمكن استخدامه كتقييم.',bothSlotsFilledToast:"تم تعبئة تقييمي المسبق والنتائج بالفعل.",levelExamAlreadyFilledToast:"يحتوي هذا المستوى بالفعل على مقرر اختبار المستوى — أزِله قبل إضافة مقرر آخر.",assessmentCheckFailedToast:"تعذر التحقق من هذا المقرر. حاول مرة أخرى.",skillsHeading:"المهارات التي يبنيها هذا المستوى",skillsCoveredHeading:"المهارات التي يكتسبها المتعلمون من هذا المسار",skillsCoveredDescription:"يحصل المتعلمون على هذه المهارات عند إنهاء المسار. وتتكون من المهارات التي تُدرّسها الدورات في كل مستوى، إضافة إلى التقييم القبلي والتقييم الختامي.",noSkillsYet:"لا توجد مهارات بعد — أضف إلى المستويات دورات موسومة بمهارات لتظهر هنا.",levelCountLabel:"{count} مستوى",levelCountLabelPlural:"{count} مستويات",courseCountLabel:"{count} مقرر",courseCountLabelPlural:"{count} مقررات",backToPathButton:"العودة إلى المسار",backToLevelButton:"العودة إلى {label}",courseDetailsLoading:"جارٍ تحميل تفاصيل المقرر…",courseDetailsEmpty:"لا يحتوي هذا المقرر على وحدات بعد.",courseDetailsError:"تعذر تحميل تفاصيل المقرر.",courseDetailsCardTitle:"تفاصيل المقرر",courseTitleFieldLabel:"العنوان",courseDescriptionFieldLabel:"الوصف",noCourseDescriptionPlaceholder:"لا يتوفر وصف.",unitsSectionLabel:"الوحدات",unitsSectionDescription:"تجمع الوحدات المحتوى المرتبط؛ كل عنصر محتوى موسوم بالمهارات التي يبنيها.",unitTopicsFieldLabel:"المواضيع",contentCountLabel:"{count} عنصر محتوى",contentCountLabelPlural:"{count} عناصر محتوى",courseUnitTopicsLabel:"{count} موضوع",courseUnitTopicsLabelPlural:"{count} مواضيع",verifyingAssessmentCourses:"جارٍ التحقق من مقررات التقييم…",resolveBeforePublishing:"حل هذه النقاط قبل النشر:",resolveBeforeSendingForReview:"حل هذه النقاط قبل الإرسال للمراجعة:",assessmentsCardHeading:"التقييم المسبق وتقييم النتائج",assessmentsCardDescription:"أضف المقررات التي تحتوي على بنك أسئلة فقط والتي تفتح وتغلق هذا المسار.",assessmentNotAddedYet:"لم تتم إضافته بعد — اختر مقررًا يحتوي على بنك أسئلة فقط من المكتبة.",viewCourseMenuItem:"عرض",priorAssessmentExplainerTitle:"لماذا لا يمكن تخطي هذا",priorAssessmentExplainerBody:"درجة بنك الأسئلة هذا هي ما يعتمد عليه كل مستوى لتحديد التخطي — ولا يوجد حتى الآن ما يُقارن به، لذا يُنفَّذ بالكامل دائمًا.",priorAssessmentPurposeLabel:"يحدد خط أساس المهارة",outcomeAssessmentExplainerTitle:"يُغلق المسار",outcomeAssessmentExplainerBody:"النجاح في بنك الأسئلة هذا هو ما يُصادق على اكتساب المهارة للمسار بأكمله — ودرجته هي ما تظهر في شهادة المتعلم.",outcomeUnlocksHint:"يُفتح بعد المستوى الأخير",assessmentCourseSectionTitle:"المقرر",assessmentCourseSectionDescription:"مقرر تقييم واحد (Evaluation Course) — لا يمكن أن يكون محتواه سوى بنوك أسئلة أو تقييم مقرر، وليس أي أنواع محتوى أخرى.",libraryOpenLevelToAdd:"افتح مستوى للإضافة",libraryAddToLevel:"إضافة إلى {level}",libraryAddPriorAssessmentCourse:"إضافة مقرر التقييم المسبق",libraryAddOutcomeAssessmentCourse:"إضافة مقرر تقييم النتائج",libraryAddLevelExamCourse:"إضافة مقرر اختبار المستوى لـ {level}",policyStrictLabel:"صارمة",policyStrictDescription:"يُنهي كل متعلم كل مستوى، بالترتيب — بصرف النظر عن درجة التقييم المسبق.",policyAdaptiveLabel:"تكيفية",policyAdaptiveDescriptionPre:"يمكن تخطي مستوى، ولكن فقط عندما تتجاوز درجة المتعلم في التقييم المسبق",policyAdaptiveDescriptionPost:" حد الإعفاء.",policyPriorLearningLabel:"التعلم المسبق",policyPriorLearningDescription:"يمكن أن يستند التخطي أيضًا إلى مهارات يمتلكها المتعلم بالفعل — شهادة موثقة أو مقرر سابق — لا التقييم وحده.",selectLevelFirstToast:"اختر مستوى أولاً",selectLevelFromOutlineToast:"افتح مستوى في هيكل المسار لإضافة المقررات — لا يمكن إضافة المقررات إلى المسار نفسه أو داخل مقرر آخر.",selectCurriculumFirstToast:"حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار قبل إضافة المقررات.",noCurriculumEmptyTitle:"لم يتم تحديد منهج أو إطار مهارات",noCurriculumEmptyHint:"حدد المنهج (Curriculum) أو إطار المهارات لهذا المسار لاستعراض المقررات.",itemAlreadyInPathToast:'"{name}" موجود بالفعل في مسار التعلم هذا',addedToLevelSuccess:'تمت إضافة "{name}" إلى المستوى',dropOntoLevelError:"أفلِت على مستوى لإضافة مقرر",dropOntoPathError:"أفلِت المقررات على مستوى، وليس على مسار التعلم مباشرة.",priorSlotFilledToast:"التقييم المسبق يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",outcomeSlotFilledToast:"التقييم الختامي يحتوي على مقرر بالفعل — أزِله قبل إضافة مقرر آخر.",levelNeedsMixedContentToast:"هذا المستوى هو الأول أو الأخير في المسار — مقرر يحتوي فقط على بنك أسئلة كمحتوى وحيد له سيُعامل كتقييم مسبق/ختامي. أضف مقررًا آخر، أو مقررًا يحتوي على أكثر من بنك الأسئلة فقط.",cannotRemoveLastRegularCourseToast:"هذا المستوى هو الأول أو الأخير في المسار — إزالة هذا المقرر ستترك فقط مقرر اختبار المستوى، وسيتم التعامل معه كتقييم مسبق/ختامي. أضف مقررًا آخر أولاً.",coursesRemovedFrameworkChangeToast:"تمت إزالة {count} من المقررات المرتبطة بمنهج مختلف من هذا المسار.",levelSkillsResetFrameworkChangeToast:"تم مسح المهارات المختارة في {count} من المستويات — فهي لا تنطبق على المنهج الجديد.",priorAssessmentNarrowedScopeToast:"أدى التقييم المسبق إلى تضييق نطاق المهارات — أصبح لدى {count} من المستويات مهارات خارج هذا النطاق.",coursesCardHeading:"المقررات",coursesCardDescription:"الدورات التي يُكملها المتعلم لاجتياز هذا المستوى. اسحب المقبض لإعادة الترتيب، واستخدم القائمة للإزالة.",coursesEmptyHint:"لا توجد دورات بعد.",courseMetaLabel:"مقرر",removeFromLevelMenuItem:"إزالة من المستوى",courseNotTeachingRoleBadge:"تُدرّس مهارات خارج هذا الدور",roleChangedCoursesFlaggedToast:"{count} دورة تُدرّس مهارات خارج الدور الجديد. تم الاحتفاظ بها ووضع علامة عليها — أزلها قبل الإرسال للمراجعة.",priorAssessmentMissingRoleSkills:"التقييم المسبق لا يختبر مهارات الدور هذه: {skills}",skillFrameworkChangedToast:"تم تغيير إطار المهارات: تم مسح الدور المستهدف ومهارات المسار.",roleSkillsCoveredDescription:"مهارات الدور المستهدف. يحصل عليها المتعلمون عند إنهاء المسار. يجب أن تُدرَّس كل مهارة منها في دورة قبل إرسال المسار للمراجعة.",roleSkillNotTaughtSuffix:"لم تُدرَّس بعد",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"لا توجد دورة في هذا المسار تُدرّس هذه المهارة بعد",roleSkillTaughtTitle:"توجد دورة في هذا المسار تُدرّس هذه المهارة",levelSkillsFromCoursesNote:"مستخرجة من الدورات في هذا المستوى. أضف دورات أو أزلها لتغييرها.",levelSkillsEmpty:"لا توجد مهارات بعد — أضف دورة إلى هذا المستوى.",levelSkillsOutsidePrior:"هذه المهارات لا يقيّمها التقييم القبلي: {skills}. أزل الدورة التي تُدرّسها."},hx={contextualEditor:vS,languageSelector:yS,collectionEditor:bS,breadcrumb:CS,tabBar:SS,contentEditForm:xS,titleAppIcon:_S,unitContentList:wS,contentRow:TS,csvUpload:ES,manageCollaborators:kS,sparkMetaForm:AS,appIconField:LS,appIconPickerModal:IS,chipGroupField:DS,dateTimeField:jS,dialcodeInputField:OS,keywordSuggestField:NS,licenseSelectField:RS,multiSelectField:PS,nestedSelectField:FS,radioField:MS,selectField:BS,textField:qS,assetBrowser:$S,resourceReorderDialog:US,assignPageNumber:VS,confirmDialog:HS,publishChecklist:zS,qualityParamsModal:QS,unsavedChangesModal:WS,filterChips:GS,libraryCard:KS,libraryDock:YS,libraryFilterPanel:ZS,libraryPreviewPanel:XS,outlineTree:JS,treeNode:ex,contentPlayer:tx,dialcodePanel:rx,progressStatus:nx,splitBuilderShell:sx,topbar:ox,reviewCommentModal:ax,confirmReviewModal:ix,generateQRModal:lx,chip:cx,dropZone:ux,spinner:dx,learningPath:fx},px={emptyStateMessage:"Sélectionnez une unité dans le plan pour modifier ses détails",reviewCommentLabel:"Commentaire du réviseur :",untitledPlaceholder:"Sans titre",nodeTitleAriaLabel:"Titre du nœud",dropZoneLabel:"Déposez ici pour ajouter du contenu à cette unité"},mx={ariaLabel:"Sélectionner la langue"},gx={errorBoundaryTitle:"Une erreur s'est produite",retryButton:"Réessayer",loadingMessage:"Chargement de l'éditeur...",loadErrorTitle:"Échec du chargement de l'éditeur"},vx={nodePathAriaLabel:"Chemin du nœud",homeAriaLabel:"Accueil"},yx={detailsTab:"Détails",audienceCurriculumTab:"Public et programme",licensingTab:"Licence",metadataSectionsAriaLabel:"Sections de métadonnées",hasErrorsAriaLabel:"Contient des erreurs"},bx={moveToAnotherUnitButton:"Déplacer vers une autre unité",collapseMetadataPanelAriaLabel:"Réduire le panneau de métadonnées",expandMetadataPanelAriaLabel:"Développer le panneau de métadonnées",collapseTitle:"Réduire",expandTitle:"Développer",iconAlt:"icône",contentNamePlaceholder:"Nom du contenu",keywordsLabel:"Mots-clés",addKeywordPlaceholder:"Ajoutez un mot-clé et appuyez sur Entrée",addButton:"Ajouter",optionalInCollectionLabel:"Facultatif dans la collection",yesOption:"Oui",noOption:"Non"},Cx={selectAppIconAriaLabel:"Sélectionner l'icône de l'application",appIconAriaLabel:"Icône de l'application",appIconAlt:"Icône de l'application",removeIconAriaLabel:"Supprimer l'icône"},Sx={removeConfirm:"Retirer ce contenu de l'unité ?",heading:"Contenu de cette unité",emptyTitle:"Aucun contenu pour le moment",emptyHint:"Faites glisser depuis la bibliothèque ou cliquez sur Ajouter du contenu",addContentAriaLabel:"Ajouter du contenu à l'unité",addContent:"Ajouter du contenu"},xx={dragToReorderAriaLabel:"Faire glisser pour réorganiser",removeAriaLabel:"Supprimer {name}"},_x={invalidFileType:"Seuls les fichiers .csv sont acceptés.",fileTooLarge:"La taille du fichier ne doit pas dépasser 50 Mo.",downloadSampleFailed:"Échec du téléchargement de l'exemple de CSV.",processingFailed:"Le traitement du téléversement a échoué. Veuillez vérifier les lignes en erreur ci-dessous.",connectionLost:"Connexion perdue pendant la vérification du statut. Veuillez réessayer.",uploadFailed:"Le téléversement a échoué. Veuillez vérifier votre fichier et réessayer.",statusUploading:"Téléversement en cours...",statusProcessing:"Traitement en cours...",statusDone:"Terminé !",statusError:"Erreur",titleUpdate:"Mettre à jour les métadonnées des dossiers via CSV",titleCreate:"Créer des dossiers via CSV",closeAriaLabel:"Fermer",dropZoneAriaLabel:"Déposez le fichier CSV ici ou cliquez pour parcourir",dropText:"Faites glisser et déposez votre CSV ici",dropSubtext:"ou cliquez pour parcourir",downloadSample:"Télécharger l'exemple de CSV",itemsImportedSuffix:"— {count} élément(s) importé(s)",failedRowsTitle:"Lignes en échec ({count})",rowHeader:"Ligne",nameHeader:"Nom",reasonHeader:"Raison",unknownError:"Erreur inconnue",cancel:"Annuler",uploaded:"Téléversé",upload:"Téléverser"},wx={saveFailed:"Échec de l'enregistrement des collaborateurs. Veuillez réessayer.",title:"Gérer les collaborateurs",closeAriaLabel:"Fermer",searchUsersLabel:"Rechercher des utilisateurs",searchPlaceholder:"Rechercher par nom ou e-mail...",searchingAriaLabel:"Recherche en cours...",searchResultsAriaLabel:"Résultats de recherche",add:"Ajouter",noUsersFound:"Aucun utilisateur trouvé.",currentCollaborators:"Collaborateurs actuels",noCollaboratorsYet:"Aucun collaborateur ajouté pour le moment.",remove:"Retirer",saveSuccess:"Collaborateurs enregistrés avec succès.",cancel:"Annuler",save:"Enregistrer"},Tx={shuffleEnabledMessage:"La lecture aléatoire est activée pour cet ensemble de questions.",noFieldsMessage:"Aucun champ configuré pour cet onglet.",skillFramework:"Cadre de compétences",selectSkillFramework:"Sélectionnez un cadre de compétences",skills:"Compétences",selectSkills:"Sélectionnez des compétences",targetRole:"Rôle cible (facultatif)",noTargetRole:"Aucun rôle cible"},Ex={requiredError:"{field} est requis",selectIconAriaLabel:"Sélectionner l'icône de l'application",iconAlt:"Icône de l'application",selectIconLabel:"Sélectionner l'icône",removeIconAriaLabel:"Supprimer l'icône de l'application",removeLabel:"Supprimer"},kx={dialogAriaLabel:"Sélectionner l'icône de l'application",title:"Sélectionner l'icône de l'application",closeAriaLabel:"Fermer",myImagesTab:"Mes images",allImagesTab:"Toutes les images",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des images…",loadingText:"Chargement…",noImagesFound:"Aucune image trouvée",noThumbnailText:"IMG",loadMoreButton:"Charger plus",previewAlt:"Aperçu",dropZoneText:"Faites glisser et déposez ou cliquez pour parcourir",acceptedTypesInfo:"{types} · max {size} Mo",cancelButton:"Annuler",uploadingText:"Téléversement…",uploadAndUseButton:"Téléverser et utiliser",useSelectedButton:"Utiliser la sélection",invalidFileTypeError:"Seuls les fichiers {types} sont acceptés.",fileTooLargeError:"L'image doit faire moins de {size} Mo.",uploadFailedError:"Le téléversement a échoué."},Ax={addPlaceholder:"Ajouter…",addButtonLabel:"Ajouter"},Lx={requiredError:"{field} est requis"},Ix={requiredError:"{field} est requis",enterCodeMessage:"Saisissez un code d'appel à valider.",validMessage:"Le code d'appel est valide.",notFoundMessage:"Code d'appel introuvable.",validationFailedMessage:"La validation a échoué. Veuillez réessayer.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Valider le code d'appel",validatingLabel:"Validation en cours…",validateButtonLabel:"Valider"},Dx={requiredError:"{field} est requis",inputPlaceholder:"Saisissez et appuyez sur Entrée ou virgule…"},jx={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner une licence…"},Ox={requiredError:"{field} est requis",selectedCountSuffix:"sélectionné(s)",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option",searchPlaceholder:"Rechercher…",noMatchesMessage:"Aucun résultat"},Nx={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…"},Rx={requiredError:"{field} est requis"},Px={requiredError:"{field} est requis",selectPlaceholder:"Sélectionner…",noOptionsMessage:"Aucune option",searchPlaceholder:"Rechercher…",noMatchesMessage:"Aucun résultat"},Fx={requiredError:"{field} est requis",maxLengthError:"Maximum {max} caractères"},Mx={dialogAriaLabel:"Navigateur de ressources",title:"Navigateur de ressources",closeAriaLabel:"Fermer",browseTab:"Parcourir",uploadTab:"Téléverser",searchPlaceholder:"Rechercher des ressources...",searchButton:"Rechercher",loadingMessage:"Chargement...",uploadingMessage:"Téléversement...",chooseFileButton:"Choisir un fichier à téléverser"},Bx={dialogAriaLabel:"Déplacer la ressource",moveHeaderPrefix:"Déplacer",closeAriaLabel:"Fermer",selectUnitHint:"Sélectionnez une unité vers laquelle déplacer ce contenu :",noUnitsAvailable:"Aucune autre unité disponible",cancelButton:"Annuler",moveButton:"Déplacer ici"},qx={dialogAriaLabel:"Attribuer des numéros de page",title:"Attribuer des numéros de page",closeAriaLabel:"Fermer",emptyState:"Aucun élément de contenu trouvé dans cette collection.",contentColumnHeader:"Contenu",pageNumberColumnHeader:"Numéro de page",cancelButton:"Annuler",saveButton:"Enregistrer"},$x={title:"Confirmer la suppression",confirmButton:"Confirmer",cancelButton:"Annuler",closeAriaLabel:"Fermer"},Ux={publishTitlePrefix:"Publier",closeAriaLabel:"Fermer",confirmPublishPrefix:"Êtes-vous sûr de vouloir publier ce",checklistInstructions:"Veuillez confirmer que TOUS les éléments suivants sont vérifiés (en cochant les cases) avant de pouvoir publier :",selectAllLabel:"Tout sélectionner",noButton:"Non",yesButton:"Oui"},Vx={reviewQualityTitle:"Évaluer la qualité",rejectContentTitle:"Rejeter le contenu",closeAriaLabel:"Fermer",qualityScoreLabel:"Score de qualité",scorePoorLabel:"0 — Faible",scoreExcellentLabel:"10 — Excellent",commentLabel:"Commentaire",optionalLabel:"(facultatif)",commentPlaceholder:"Ajoutez des remarques pour le créateur du contenu…",rejectionReasonLabel:"Motif du rejet",rejectReasonPlaceholder:"Décrivez pourquoi ce contenu est rejeté…",rejectionRequiredMessage:"Un motif de rejet est requis.",cancelButton:"Annuler",approveButton:"Approuver",rejectButton:"Rejeter"},Hx={title:"Modifications non enregistrées",closeAriaLabel:"Fermer",bodyMessage:"Vous avez des modifications non enregistrées. Souhaitez-vous les enregistrer avant de quitter ?",cancelButton:"Annuler",discardButton:"Ignorer",saveButton:"Enregistrer"},zx={contentTypeFiltersAriaLabel:"Filtres par type de contenu"},Qx={alreadyAddedAriaLabel:"Déjà ajouté",alreadyAddedTitle:"Déjà ajouté à cette collection",addItemAriaLabel:"Ajouter {name} à l'unité",addToUnitTitle:"Ajouter à l'unité",selectUnitToAddTitle:"Sélectionner une unité pour ajouter",draftOnlyTitle:"Seul le contenu à l'état de brouillon peut être ajouté",moreSkills:"+{count} de plus"},Wx={selectUnitFirstToast:"Sélectionnez d'abord une unité",selectUnitFromOutlineToast:"Sélectionnez une unité dans le plan pour ajouter du contenu — les ressources ne peuvent pas être ajoutées directement au cours.",itemAlreadyAddedToast:"« {name} » est déjà dans cette collection",itemAddedToast:"« {name} » ajouté",collapseLibraryPanelAriaLabel:"Réduire le panneau de la bibliothèque",collapseLibraryTitle:"Réduire la bibliothèque",cancelTargetAriaLabel:"Annuler — revenir à la navigation",headerTitle:"Bibliothèque",searchPlaceholder:"Rechercher du contenu…",searchAriaLabel:"Rechercher dans la bibliothèque",sortAZAriaLabel:"Trier : A–Z (cliquer pour Récent)",sortRecentAriaLabel:"Trier : Récent (cliquer pour A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Récent",toggleAdvancedFiltersAriaLabel:"Afficher/masquer les filtres avancés",advancedFiltersTitle:"Filtres avancés",libraryContentAriaLabel:"Contenu de la bibliothèque",loadMoreAriaLabel:"Charger plus de contenu",loadingText:"Chargement…",loadMoreText:"Charger plus",noContentFound:"Aucun contenu trouvé",tryDifferentSearch:"Essayez une autre recherche ou un autre filtre",noSkillMatchTitle:"Aucun contenu n'enseigne encore les compétences de ce cours",noSkillMatchHint:"Un contenu apparaît ici dès qu'il est associé uniquement aux compétences de ce cours. Tout le reste se trouve dans Autres contenus.",matchingHeading:"Enseigne les compétences de ce cours",otherContentHeading:"Autres contenus ({count})",otherContentHint:"Ces contenus enseignent des compétences hors de ce cours, ou aucune. Vous pouvez quand même les ajouter.",pickSkillsHint:"Choisissez les compétences de ce cours pour voir d'abord les contenus qui les enseignent."},Gx={boardLabel:"Conseil",mediumLabel:"Médium",classLabel:"Classe",subjectLabel:"Matière",primaryCategoryLabel:"Catégorie principale",filterLibraryAriaLabel:"Filtrer la bibliothèque",filtersHeaderTitle:"Filtres",closeFiltersAriaLabel:"Fermer les filtres",resetButton:"Réinitialiser",applyButton:"Appliquer"},Kx={contentPreviewAriaLabel:"Aperçu du contenu",closePreviewAriaLabel:"Fermer l'aperçu",addToUnitButton:"+ Ajouter à l'unité"},Yx={maxDepthReachedToast:"Profondeur maximale atteinte",downloadCsvFailedToast:"Échec du téléchargement du CSV",outlineRefreshedToast:"Plan du cours actualisé.",outlineRefreshFailedToast:"Le plan n'a pas pu être actualisé automatiquement. Veuillez recharger la page.",moreOptionsAriaLabel:"Plus d'options",moreOptionsTitle:"Plus d'options",foldersExistTitle:"Des dossiers existent déjà — utilisez « Mettre à jour » à la place",createFoldersCsvButton:"Créer des dossiers à partir d'un fichier CSV",noFoldersYetTitle:"Aucun dossier pour le moment — utilisez d'abord « Créer »",downloadFoldersCsvButton:"Télécharger les dossiers en fichier CSV",updateFoldersCsvButton:"Mettre à jour les métadonnées des dossiers à partir d'un fichier CSV",expandOutlineAriaLabel:"Développer le plan",collapseOutlineAriaLabel:"Réduire le plan",addUnitButton:"Ajouter une unité",addSubunitButton:"Ajouter une sous-unité"},Zx={expandAriaLabel:"Développer",collapseAriaLabel:"Réduire",dropHereLabel:"Déposer ici",nodeOptionsAriaLabel:"Options du nœud",renameMenuItem:"Renommer",addSubunitMenuItem:"Ajouter une sous-unité",addSiblingMenuItem:"Ajouter un élément au même niveau",deleteMenuItem:"Supprimer"},Xx={mimeLabelVideo:"Vidéo",mimeLabelAudio:"Audio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Contenu",infoFieldAuthor:"Auteur",infoFieldLicense:"Licence",infoFieldLanguage:"Langue",infoFieldClass:"Classe",infoFieldSubject:"Matière",infoFieldType:"Type",loadingPreview:"Chargement de l'aperçu…",previewPlayerUnavailable:"Lecteur d'aperçu indisponible. Vérifiez que /content/preview est accessible.",failedToInitializePlayer:"Échec de l'initialisation du lecteur de contenu.",previewPlayerLoadFailed:"Le lecteur d'aperçu n'a pas pu être chargé.",unableToLoadQuestionset:"Impossible de charger l'ensemble de questions :",parentQuestionsetNotResolved:"Impossible de résoudre l'ensemble de questions parent pour cette question.",questionNotFoundInQuestionset:"Question introuvable dans l'ensemble de questions."},Jx={title:"Code QR (Dialcode)",invalidFormatError:"Format de code DIAL invalide. Utilisez uniquement des lettres majuscules et des chiffres (ex. A1B2C3).",duplicateDialcodeError:"Le code DIAL « {code} » est déjà associé à un autre nœud de cette collection.",dialcodeNotFoundError:"Code d'appel introuvable. Veuillez saisir un code valide.",linkFailedError:"Échec de l'association du code d'appel. Veuillez réessayer.",unlinkFailedError:"Échec de la suppression du code d'appel. Veuillez réessayer.",qrCodeAltPrefix:"Code QR pour",linkedCodeLabel:"Code associé :",removeButton:"Supprimer",noCodeLinkedMessage:"Aucun code QR associé à ce contenu.",linkManuallyLabel:"Associer manuellement",dialcodeInputPlaceholder:"Saisissez le code d'appel (ex. A1B2C3)",dialcodeInputAriaLabel:"Champ de saisie du code d'appel",linkButton:"Associer",linkedSuccessMessage:"Code d'appel associé avec succès."},e_={unitsAddedLabel:"Unités ajoutées",contentItemsLabel:"Éléments de contenu",progressLabel:"Progression"},t_={dropOntoUnitError:"Déposez sur une unité pour ajouter du contenu",dropOntoCourseError:"Déposez le contenu sur une unité, pas directement sur le cours.",alreadyInCollectionError:"« {name} » est déjà dans cette collection",addedToUnitSuccess:"« {name} » ajouté à l'unité",fillRequiredMetadataError:"Veuillez renseigner les métadonnées requises",outlineAriaLabel:"Plan du cours",showOutlineTitle:"Afficher le plan",editorAriaLabel:"Éditeur de contenu",libraryAriaLabel:"Bibliothèque de contenu",showLibraryTitle:"Afficher la bibliothèque"},r_={draftStatusFallback:"Brouillon",backAriaLabel:"Retour",statusAriaLabelPrefix:"Statut :",savingIndicator:"Enregistrement…",unsavedIndicator:"Non enregistré",savedIndicatorPrefix:"Enregistré",fillRequiredFieldsTooltip:"Renseignez tous les champs requis avant d'enregistrer",saveAsDraftButton:"Enregistrer comme brouillon",sendForReviewButton:"Envoyer pour révision",collaboratorsLabel:"Collaborateurs",qrCodesLabel:"Codes QR",generatingEllipsis:"Génération en cours…",generateQrCodesMenuItem:"Générer des codes QR",downloadingEllipsis:"Téléchargement…",downloadQrCodesMenuItem:"Télécharger les codes QR",publishButton:"Publier",requestForChangesButton:"Demander des modifications",approveButton:"Approuver",qrGenerationStartedToast:"La génération des codes QR a démarré. Utilisez « Télécharger les codes QR » une fois prêts.",qrGenerationFailedToast:"Échec de la génération des codes QR. Veuillez réessayer.",qrCodesNotGeneratedToast:"Aucun code QR généré pour le moment. Générez d'abord des codes QR.",qrGenerationInProgressToast:"La génération des images de codes QR est en cours. Veuillez réessayer le téléchargement dans quelques instants.",qrCodesNotReadyToast:"Les codes QR ne sont pas encore prêts. Veuillez patienter et réessayer.",qrCodesDownloadedToast:"Codes QR téléchargés.",qrCodesDownloadFailedToast:"Échec du téléchargement des codes QR.",requestChangesTitle:"Demander des modifications",changesRequestedLabel:"Modifications demandées",describeChangesPlaceholder:"Décrivez les modifications que l'auteur doit apporter"},n_={closeAriaLabel:"Fermer",fillCommentsError:"Renseignez les commentaires",cancelButton:"Annuler"},s_={closeAriaLabel:"Fermer",title:"Acceptation des conditions générales",agreementTextPart1:"J'accepte qu'en soumettant / publiant ce contenu, je confirme qu'il est conforme aux directives prescrites, y compris les conditions d'utilisation et la politique de contenu, et que je consens à le publier selon le",creativeCommonsLinkText:"cadre Creative Commons",agreementTextPart2:"conformément à la",contentPolicyText:"politique de contenu",agreementTextPart3:". Je me suis assuré(e) de ne pas porter atteinte aux droits d'auteur ou à la vie privée d'autrui.",cancelButton:"Annuler",submitButton:"Soumettre"},o_={closeAriaLabel:"Fermer",title:"Générer des codes QR",numberOfCodesLabel:"Nombre de codes QR",countPlaceholder:"Saisissez un nombre (2–250)",countRangeError:"Saisissez un nombre entre 2 et 250.",cancelButton:"Annuler",generateButton:"Générer"},a_={remove:"Supprimer"},i_={dropHere:"Déposer ici"},l_={loading:"Chargement"},c_={profileBadgeLabel:"Parcours d'apprentissage",pathStructureLabel:"Structure du parcours",addLevelButton:"Ajouter un niveau",levelNumberPrefix:"Niveau {n}",priorAssessmentLabel:"Évaluation préalable",priorAssessmentHint:"Toujours requise · ne compte pas comme un niveau",outcomeAssessmentLabel:"Évaluation finale",outcomeAssessmentHint:"Confirme le résultat · ne compte pas comme un niveau",skillCheckBadge:"Vérification des compétences",outcomeCheckBadge:"Vérification du résultat",assessmentCourseMeta:"Cours · Questionnaire uniquement",addAssessmentSlotButton:"Ajouter {label} — un cours contenant uniquement un questionnaire",addCourseToLevelButton:"Ajouter un cours depuis la bibliothèque",addLevelExamButton:"Ajouter l'examen de niveau — un cours contenant uniquement un questionnaire",levelExamMeta:"Examen de niveau · Questionnaire uniquement",requiredSlotBadge:"Obligatoire",removeAssessmentSlotButton:"Retirer",deletePriorAssessmentConfirm:"Supprimer l'évaluation préalable retire le score sur lequel se basent les sauts adaptatifs de ce parcours. Continuer ?",deleteAssessmentSlotConfirm:"Retirer ce cours d'évaluation du parcours ?",deleteLevelExamConfirm:"Retirer ce cours d'examen de niveau du niveau ?",deleteLevelConfirm:"Supprimer « {name} » et tout son contenu ?",deleteCourseConfirm:"Retirer ce cours du parcours ?",deleteMultipleConfirm:"Supprimer les {count} éléments sélectionnés du parcours ?",courseNameUnavailable:"Détails du cours indisponibles",notAssessmentCourseToast:"« {name} » n'est pas un Cours d'évaluation, il ne peut donc pas être utilisé comme évaluation.",bothSlotsFilledToast:"Les évaluations préalable et finale sont déjà renseignées.",levelExamAlreadyFilledToast:"Ce niveau a déjà un cours d'examen de niveau — retirez-le avant d'en ajouter un autre.",assessmentCheckFailedToast:"Impossible de vérifier ce cours. Veuillez réessayer.",skillsHeading:"Compétences développées dans ce niveau",skillsCoveredHeading:"Compétences acquises avec ce parcours",skillsCoveredDescription:"Les apprenants obtiennent ces compétences en terminant le parcours. Elles regroupent les compétences enseignées par les cours de chaque niveau, ainsi que l'évaluation préalable et l'évaluation finale.",noSkillsYet:"Aucune compétence pour l'instant — ajoutez aux niveaux des cours associés à des compétences pour les voir ici.",levelCountLabel:"{count} niveau",levelCountLabelPlural:"{count} niveaux",courseCountLabel:"{count} cours",courseCountLabelPlural:"{count} cours",backToPathButton:"Retour au parcours",backToLevelButton:"Retour à {label}",courseDetailsLoading:"Chargement des détails du cours…",courseDetailsEmpty:"Ce cours ne contient pas encore d'unités.",courseDetailsError:"Impossible de charger les détails du cours.",courseDetailsCardTitle:"Détails du cours",courseTitleFieldLabel:"Titre",courseDescriptionFieldLabel:"Description",noCourseDescriptionPlaceholder:"Aucune description disponible.",unitsSectionLabel:"Unités",unitsSectionDescription:"Les unités regroupent le contenu associé ; chaque contenu est associé aux compétences qu'il développe.",unitTopicsFieldLabel:"Sujets",contentCountLabel:"{count} contenu",contentCountLabelPlural:"{count} contenus",courseUnitTopicsLabel:"{count} sujet",courseUnitTopicsLabelPlural:"{count} sujets",verifyingAssessmentCourses:"Vérification des cours d'évaluation…",resolveBeforePublishing:"Résolvez les points suivants avant de publier :",resolveBeforeSendingForReview:"Résolvez les points suivants avant d'envoyer pour révision :",assessmentsCardHeading:"Évaluations préalable et finale",assessmentsCardDescription:"Ajoutez les cours composés uniquement d'un questionnaire qui ouvrent et ferment ce parcours.",assessmentNotAddedYet:"Pas encore ajouté — choisissez un cours composé uniquement d'un questionnaire dans la bibliothèque.",viewCourseMenuItem:"Voir",priorAssessmentExplainerTitle:"Pourquoi cela ne peut pas être ignoré",priorAssessmentExplainerBody:"Le score de ce questionnaire est ce que chaque niveau utilise pour décider d'un saut — il n'y a encore rien à comparer, donc il s'exécute toujours en entier.",priorAssessmentPurposeLabel:"Établit la base de compétences",outcomeAssessmentExplainerTitle:"Termine le parcours",outcomeAssessmentExplainerBody:"Réussir ce questionnaire certifie l'acquisition de la compétence pour l'ensemble du parcours — son score est celui qui apparaît sur le certificat de l'apprenant.",outcomeUnlocksHint:"Se débloque après le dernier niveau",assessmentCourseSectionTitle:"Cours",assessmentCourseSectionDescription:"Un seul Cours d'évaluation — son contenu ne peut être que des questionnaires ou une Évaluation de cours, jamais d'autres types de contenu.",libraryOpenLevelToAdd:"Ouvrez un niveau pour ajouter",libraryAddToLevel:"Ajouter à {level}",libraryAddPriorAssessmentCourse:"Ajouter le cours d'évaluation préalable",libraryAddOutcomeAssessmentCourse:"Ajouter le cours d'évaluation finale",libraryAddLevelExamCourse:"Ajouter le cours d'examen de niveau pour {level}",policyStrictLabel:"Strict",policyStrictDescription:"Chaque apprenant termine chaque niveau, dans l'ordre — quel que soit le score de l'évaluation préalable.",policyAdaptiveLabel:"Adaptatif",policyAdaptiveDescriptionPre:"Un niveau peut être ignoré, mais seulement si le score de l'apprenant à l'Évaluation préalable",policyAdaptiveDescriptionPost:" dépasse le seuil de dispense.",policyPriorLearningLabel:"Acquis antérieurs",policyPriorLearningDescription:"Les sauts peuvent aussi s'appuyer sur des compétences déjà détenues par l'apprenant — un certificat vérifié ou un cours antérieur — pas seulement l'évaluation.",selectLevelFirstToast:"Sélectionnez d'abord un niveau",selectLevelFromOutlineToast:"Ouvrez un niveau dans la structure du parcours pour ajouter des cours — les cours ne peuvent pas être ajoutés au parcours lui-même ni sous un autre cours.",selectCurriculumFirstToast:"Sélectionnez un programme (Curriculum) ou un cadre de compétences pour ce parcours avant d'ajouter des cours.",noCurriculumEmptyTitle:"Aucun programme ni cadre de compétences sélectionné",noCurriculumEmptyHint:"Sélectionnez un programme (Curriculum) ou un cadre de compétences pour ce parcours afin de parcourir les cours.",itemAlreadyInPathToast:"« {name} » fait déjà partie de ce parcours d'apprentissage",addedToLevelSuccess:"« {name} » ajouté au niveau",dropOntoLevelError:"Déposez sur un niveau pour ajouter un cours",dropOntoPathError:"Déposez les cours sur un niveau, pas directement sur le parcours d'apprentissage.",priorSlotFilledToast:"L'Évaluation préalable contient déjà un cours — retirez-le avant d'en ajouter un autre.",outcomeSlotFilledToast:"L'Évaluation finale contient déjà un cours — retirez-le avant d'en ajouter un autre.",levelNeedsMixedContentToast:"Ce niveau est premier ou dernier dans le parcours — un cours composé uniquement de bancs de questions comme seul contenu sera traité comme une évaluation préalable/finale. Ajoutez un autre cours, ou un cours contenant plus que des bancs de questions.",cannotRemoveLastRegularCourseToast:"Ce niveau est premier ou dernier dans le parcours — retirer ce cours ne laisserait que le cours d'examen de niveau, qui serait alors traité comme une évaluation préalable/finale. Ajoutez d'abord un autre cours.",coursesRemovedFrameworkChangeToast:"{count} cours associé(s) à un autre curriculum ont été retirés de ce parcours.",levelSkillsResetFrameworkChangeToast:"{count} niveau(x) ont eu leurs compétences sélectionnées effacées — elles ne s'appliquent pas au nouveau curriculum.",priorAssessmentNarrowedScopeToast:"L'évaluation préalable a réduit le périmètre des compétences — {count} niveau(x) ont désormais des compétences hors de ce périmètre.",coursesCardHeading:"Cours",coursesCardDescription:"Cours qu'un apprenant termine pour valider ce niveau. Faites glisser la poignée pour réordonner, utilisez le menu pour retirer.",coursesEmptyHint:"Aucun cours pour l'instant.",courseMetaLabel:"Cours",removeFromLevelMenuItem:"Retirer du niveau",courseNotTeachingRoleBadge:"Enseigne des compétences hors de ce rôle",roleChangedCoursesFlaggedToast:"{count} cours enseignent des compétences hors du nouveau rôle. Ils sont conservés et signalés — retirez-les avant de soumettre à révision.",priorAssessmentMissingRoleSkills:"L'évaluation préalable ne teste pas ces compétences du rôle : {skills}",skillFrameworkChangedToast:"Cadre de compétences modifié : le rôle cible et les compétences du parcours ont été effacés.",roleSkillsCoveredDescription:"Les compétences du rôle cible. Les apprenants les obtiennent en terminant le parcours. Chacune doit être enseignée par un cours avant que le parcours puisse être soumis à révision.",roleSkillNotTaughtSuffix:"pas encore enseignée",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"Aucun cours de ce parcours n'enseigne encore cette compétence",roleSkillTaughtTitle:"Un cours de ce parcours enseigne cette compétence",levelSkillsFromCoursesNote:"Déduites des cours de ce niveau. Ajoutez ou retirez des cours pour les modifier.",levelSkillsEmpty:"Aucune compétence pour l'instant — ajoutez un cours à ce niveau.",levelSkillsOutsidePrior:"Ces compétences ne sont pas évaluées par l'évaluation préalable : {skills}. Retirez le cours qui les enseigne."},u_={contextualEditor:px,languageSelector:mx,collectionEditor:gx,breadcrumb:vx,tabBar:yx,contentEditForm:bx,titleAppIcon:Cx,unitContentList:Sx,contentRow:xx,csvUpload:_x,manageCollaborators:wx,sparkMetaForm:Tx,appIconField:Ex,appIconPickerModal:kx,chipGroupField:Ax,dateTimeField:Lx,dialcodeInputField:Ix,keywordSuggestField:Dx,licenseSelectField:jx,multiSelectField:Ox,nestedSelectField:Nx,radioField:Rx,selectField:Px,textField:Fx,assetBrowser:Mx,resourceReorderDialog:Bx,assignPageNumber:qx,confirmDialog:$x,publishChecklist:Ux,qualityParamsModal:Vx,unsavedChangesModal:Hx,filterChips:zx,libraryCard:Qx,libraryDock:Wx,libraryFilterPanel:Gx,libraryPreviewPanel:Kx,outlineTree:Yx,treeNode:Zx,contentPlayer:Xx,dialcodePanel:Jx,progressStatus:e_,splitBuilderShell:t_,topbar:r_,reviewCommentModal:n_,confirmReviewModal:s_,generateQRModal:o_,chip:a_,dropZone:i_,spinner:l_,learningPath:c_},d_={emptyStateMessage:"Selecione uma unidade no esquema para editar seus detalhes",reviewCommentLabel:"Comentário do revisor:",untitledPlaceholder:"Sem título",nodeTitleAriaLabel:"Título do nó",dropZoneLabel:"Solte para adicionar conteúdo a esta unidade"},f_={ariaLabel:"Selecionar idioma"},h_={errorBoundaryTitle:"Algo deu errado",retryButton:"Tentar novamente",loadingMessage:"Carregando editor...",loadErrorTitle:"Falha ao carregar o editor"},p_={nodePathAriaLabel:"Caminho do nó",homeAriaLabel:"Início"},m_={detailsTab:"Detalhes",audienceCurriculumTab:"Público e Currículo",licensingTab:"Licenciamento",metadataSectionsAriaLabel:"Seções de metadados",hasErrorsAriaLabel:"Contém erros"},g_={moveToAnotherUnitButton:"Mover para outra unidade",collapseMetadataPanelAriaLabel:"Recolher painel de metadados",expandMetadataPanelAriaLabel:"Expandir painel de metadados",collapseTitle:"Recolher",expandTitle:"Expandir",iconAlt:"ícone",contentNamePlaceholder:"Nome do conteúdo",keywordsLabel:"Palavras-chave",addKeywordPlaceholder:"Adicione uma palavra-chave e pressione Enter",addButton:"Adicionar",optionalInCollectionLabel:"Opcional na coleção",yesOption:"Sim",noOption:"Não"},v_={selectAppIconAriaLabel:"Selecionar ícone do aplicativo",appIconAriaLabel:"Ícone do aplicativo",appIconAlt:"Ícone do aplicativo",removeIconAriaLabel:"Remover ícone"},y_={removeConfirm:"Remover este conteúdo da unidade?",heading:"Conteúdo nesta unidade",emptyTitle:"Ainda não há conteúdo",emptyHint:"Arraste da biblioteca ou clique em Adicionar conteúdo",addContentAriaLabel:"Adicionar conteúdo à unidade",addContent:"Adicionar conteúdo"},b_={dragToReorderAriaLabel:"Arrastar para reordenar",removeAriaLabel:"Remover {name}"},C_={invalidFileType:"Somente arquivos .csv são aceitos.",fileTooLarge:"O tamanho do arquivo não deve exceder 50 MB.",downloadSampleFailed:"Falha ao baixar o CSV de exemplo.",processingFailed:"Falha no processamento do upload. Verifique as linhas com erro abaixo.",connectionLost:"Conexão perdida ao verificar o status. Tente novamente.",uploadFailed:"Falha no envio. Verifique seu arquivo e tente novamente.",statusUploading:"Enviando...",statusProcessing:"Processando...",statusDone:"Concluído!",statusError:"Erro",titleUpdate:"Atualizar metadados das pastas via CSV",titleCreate:"Criar pastas via CSV",closeAriaLabel:"Fechar",dropZoneAriaLabel:"Solte o arquivo CSV aqui ou clique para procurar",dropText:"Arraste e solte seu CSV aqui",dropSubtext:"ou clique para procurar",downloadSample:"Baixar CSV de exemplo",itemsImportedSuffix:"— {count} item(ns) importado(s)",failedRowsTitle:"Linhas com falha ({count})",rowHeader:"Linha",nameHeader:"Nome",reasonHeader:"Motivo",unknownError:"Erro desconhecido",cancel:"Cancelar",uploaded:"Enviado",upload:"Enviar"},S_={saveFailed:"Falha ao salvar colaboradores. Tente novamente.",title:"Gerenciar colaboradores",closeAriaLabel:"Fechar",searchUsersLabel:"Buscar usuários",searchPlaceholder:"Buscar por nome ou e-mail...",searchingAriaLabel:"Buscando...",searchResultsAriaLabel:"Resultados da busca",add:"Adicionar",noUsersFound:"Nenhum usuário encontrado.",currentCollaborators:"Colaboradores atuais",noCollaboratorsYet:"Nenhum colaborador adicionado ainda.",remove:"Remover",saveSuccess:"Colaboradores salvos com sucesso.",cancel:"Cancelar",save:"Salvar"},x_={shuffleEnabledMessage:"A ordem aleatória está ativada para este conjunto de questões.",noFieldsMessage:"Nenhum campo configurado para esta aba.",skillFramework:"Estrutura de habilidades",selectSkillFramework:"Selecione uma estrutura de habilidades",skills:"Habilidades",selectSkills:"Selecione habilidades",targetRole:"Função-alvo (opcional)",noTargetRole:"Nenhuma função-alvo"},__={requiredError:"{field} é obrigatório",selectIconAriaLabel:"Selecionar ícone do aplicativo",iconAlt:"Ícone do aplicativo",selectIconLabel:"Selecionar ícone",removeIconAriaLabel:"Remover ícone do aplicativo",removeLabel:"Remover"},w_={dialogAriaLabel:"Selecionar ícone do aplicativo",title:"Selecionar ícone do aplicativo",closeAriaLabel:"Fechar",myImagesTab:"Minhas imagens",allImagesTab:"Todas as imagens",uploadTab:"Enviar",searchPlaceholder:"Buscar imagens…",loadingText:"Carregando…",noImagesFound:"Nenhuma imagem encontrada",noThumbnailText:"IMG",loadMoreButton:"Carregar mais",previewAlt:"Pré-visualização",dropZoneText:"Arraste e solte ou clique para procurar",acceptedTypesInfo:"{types} · máx. {size} MB",cancelButton:"Cancelar",uploadingText:"Enviando…",uploadAndUseButton:"Enviar e usar",useSelectedButton:"Usar selecionado",invalidFileTypeError:"Somente arquivos {types} são aceitos.",fileTooLargeError:"A imagem deve ter menos de {size} MB.",uploadFailedError:"Falha no envio."},T_={addPlaceholder:"Adicionar…",addButtonLabel:"Adicionar"},E_={requiredError:"{field} é obrigatório"},k_={requiredError:"{field} é obrigatório",enterCodeMessage:"Insira um código dial para validar.",validMessage:"O código dial é válido.",notFoundMessage:"Código dial não encontrado.",validationFailedMessage:"Falha na validação. Tente novamente.",placeholderExample:"ex. A1B2C3",validateAriaLabel:"Validar código dial",validatingLabel:"Validando…",validateButtonLabel:"Validar"},A_={requiredError:"{field} é obrigatório",inputPlaceholder:"Digite e pressione Enter ou vírgula…"},L_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar licença…"},I_={requiredError:"{field} é obrigatório",selectedCountSuffix:"selecionado(s)",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções",searchPlaceholder:"Pesquisar…",noMatchesMessage:"Nenhum resultado"},D_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…"},j_={requiredError:"{field} é obrigatório"},O_={requiredError:"{field} é obrigatório",selectPlaceholder:"Selecionar…",noOptionsMessage:"Sem opções",searchPlaceholder:"Pesquisar…",noMatchesMessage:"Nenhum resultado"},N_={requiredError:"{field} é obrigatório",maxLengthError:"Máx. {max} caracteres"},R_={dialogAriaLabel:"Navegador de recursos",title:"Navegador de recursos",closeAriaLabel:"Fechar",browseTab:"Procurar",uploadTab:"Enviar",searchPlaceholder:"Buscar recursos...",searchButton:"Buscar",loadingMessage:"Carregando...",uploadingMessage:"Enviando...",chooseFileButton:"Escolher arquivo para enviar"},P_={dialogAriaLabel:"Mover recurso",moveHeaderPrefix:"Mover",closeAriaLabel:"Fechar",selectUnitHint:"Selecione uma unidade para mover este conteúdo:",noUnitsAvailable:"Nenhuma outra unidade disponível",cancelButton:"Cancelar",moveButton:"Mover para aqui"},F_={dialogAriaLabel:"Atribuir números de página",title:"Atribuir números de página",closeAriaLabel:"Fechar",emptyState:"Nenhum item de conteúdo encontrado nesta coleção.",contentColumnHeader:"Conteúdo",pageNumberColumnHeader:"Número da página",cancelButton:"Cancelar",saveButton:"Salvar"},M_={title:"Confirmar exclusão",confirmButton:"Confirmar",cancelButton:"Cancelar",closeAriaLabel:"Fechar"},B_={publishTitlePrefix:"Publicar",closeAriaLabel:"Fechar",confirmPublishPrefix:"Tem certeza de que deseja publicar este(a)",checklistInstructions:"Confirme que TODOS os itens a seguir foram verificados (marcando as caixas de seleção) antes de publicar:",selectAllLabel:"Selecionar tudo",noButton:"Não",yesButton:"Sim"},q_={reviewQualityTitle:"Revisar qualidade",rejectContentTitle:"Rejeitar conteúdo",closeAriaLabel:"Fechar",qualityScoreLabel:"Nota de qualidade",scorePoorLabel:"0 — Ruim",scoreExcellentLabel:"10 — Excelente",commentLabel:"Comentário",optionalLabel:"(opcional)",commentPlaceholder:"Adicione observações para o criador do conteúdo…",rejectionReasonLabel:"Motivo da rejeição",rejectReasonPlaceholder:"Descreva por que este conteúdo está sendo rejeitado…",rejectionRequiredMessage:"É necessário informar um motivo de rejeição.",cancelButton:"Cancelar",approveButton:"Aprovar",rejectButton:"Rejeitar"},$_={title:"Alterações não salvas",closeAriaLabel:"Fechar",bodyMessage:"Você tem alterações não salvas. Deseja salvá-las antes de sair?",cancelButton:"Cancelar",discardButton:"Descartar",saveButton:"Salvar"},U_={contentTypeFiltersAriaLabel:"Filtros de tipo de conteúdo"},V_={alreadyAddedAriaLabel:"Já adicionado",alreadyAddedTitle:"Já adicionado a esta coleção",addItemAriaLabel:"Adicionar {name} à unidade",addToUnitTitle:"Adicionar à unidade",selectUnitToAddTitle:"Selecione uma unidade para adicionar",draftOnlyTitle:"Somente conteúdo em rascunho pode ser adicionado",moreSkills:"+{count} mais"},H_={selectUnitFirstToast:"Selecione uma unidade primeiro",selectUnitFromOutlineToast:"Selecione uma unidade no esquema para adicionar conteúdo — recursos não podem ser adicionados diretamente ao curso.",itemAlreadyAddedToast:'"{name}" já está nesta coleção',itemAddedToast:'"{name}" adicionado',collapseLibraryPanelAriaLabel:"Recolher painel da biblioteca",collapseLibraryTitle:"Recolher biblioteca",cancelTargetAriaLabel:"Cancelar — voltar à navegação",headerTitle:"Biblioteca",searchPlaceholder:"Buscar conteúdo…",searchAriaLabel:"Buscar na biblioteca",sortAZAriaLabel:"Ordenar: A–Z (clique para Recentes)",sortRecentAriaLabel:"Ordenar: Recentes (clique para A–Z)",sortAZTitle:"A–Z",sortRecentTitle:"Recentes",toggleAdvancedFiltersAriaLabel:"Alternar filtros avançados",advancedFiltersTitle:"Filtros avançados",libraryContentAriaLabel:"Conteúdo da biblioteca",loadMoreAriaLabel:"Carregar mais conteúdo",loadingText:"Carregando…",loadMoreText:"Carregar mais",noContentFound:"Nenhum conteúdo encontrado",tryDifferentSearch:"Tente uma busca ou filtro diferente",noSkillMatchTitle:"Ainda não há conteúdo que ensine as habilidades deste curso",noSkillMatchHint:"O conteúdo aparece aqui quando é marcado apenas com as habilidades deste curso. Todo o resto está em Outros conteúdos.",matchingHeading:"Ensina as habilidades deste curso",otherContentHeading:"Outros conteúdos ({count})",otherContentHint:"Estes ensinam habilidades fora deste curso, ou nenhuma. Você ainda pode adicioná-los.",pickSkillsHint:"Escolha as habilidades deste curso para ver primeiro o conteúdo que as ensina."},z_={boardLabel:"Conselho",mediumLabel:"Idioma de Instrução",classLabel:"Série",subjectLabel:"Disciplina",primaryCategoryLabel:"Categoria principal",filterLibraryAriaLabel:"Filtrar biblioteca",filtersHeaderTitle:"Filtros",closeFiltersAriaLabel:"Fechar filtros",resetButton:"Redefinir",applyButton:"Aplicar"},Q_={contentPreviewAriaLabel:"Pré-visualização do conteúdo",closePreviewAriaLabel:"Fechar pré-visualização",addToUnitButton:"+ Adicionar à unidade"},W_={maxDepthReachedToast:"Profundidade máxima atingida",downloadCsvFailedToast:"Falha ao baixar o CSV",outlineRefreshedToast:"Esquema do curso atualizado.",outlineRefreshFailedToast:"Não foi possível atualizar o esquema automaticamente. Recarregue a página.",moreOptionsAriaLabel:"Mais opções",moreOptionsTitle:"Mais opções",foldersExistTitle:'As pastas já existem — use "Atualizar"',createFoldersCsvButton:"Criar pastas usando arquivo csv",noFoldersYetTitle:'Ainda não há pastas — use "Criar" primeiro',downloadFoldersCsvButton:"Baixar pastas como arquivo csv",updateFoldersCsvButton:"Atualizar metadados das pastas usando arquivo csv",expandOutlineAriaLabel:"Expandir esquema",collapseOutlineAriaLabel:"Recolher esquema",addUnitButton:"Adicionar unidade",addSubunitButton:"Adicionar subunidade"},G_={expandAriaLabel:"Expandir",collapseAriaLabel:"Recolher",dropHereLabel:"Solte aqui",nodeOptionsAriaLabel:"Opções do nó",renameMenuItem:"Renomear",addSubunitMenuItem:"Adicionar subunidade",addSiblingMenuItem:"Adicionar item no mesmo nível",deleteMenuItem:"Excluir"},K_={mimeLabelVideo:"Vídeo",mimeLabelAudio:"Áudio",mimeLabelPdf:"PDF",mimeLabelEpub:"ePub",mimeLabelEcml:"ECML",mimeLabelH5p:"H5P",mimeLabelScorm:"SCORM",mimeLabelOther:"Conteúdo",infoFieldAuthor:"Autor",infoFieldLicense:"Licença",infoFieldLanguage:"Idioma",infoFieldClass:"Série",infoFieldSubject:"Disciplina",infoFieldType:"Tipo",loadingPreview:"Carregando pré-visualização…",previewPlayerUnavailable:"Player de pré-visualização indisponível. Verifique se /content/preview está acessível.",failedToInitializePlayer:"Falha ao inicializar o player de conteúdo.",previewPlayerLoadFailed:"Não foi possível carregar o player de pré-visualização.",unableToLoadQuestionset:"Não foi possível carregar o conjunto de questões:",parentQuestionsetNotResolved:"Não foi possível identificar o conjunto de questões principal desta questão.",questionNotFoundInQuestionset:"Questão não encontrada no conjunto de questões."},Y_={title:"Código QR (Dialcode)",invalidFormatError:"Formato de código DIAL inválido. Use apenas letras maiúsculas e números (ex. A1B2C3).",duplicateDialcodeError:'O código DIAL "{code}" já está vinculado a outro nó nesta coleção.',dialcodeNotFoundError:"Dialcode não encontrado. Insira um código válido.",linkFailedError:"Falha ao vincular o dialcode. Tente novamente.",unlinkFailedError:"Falha ao remover o dialcode. Tente novamente.",qrCodeAltPrefix:"Código QR para",linkedCodeLabel:"Código vinculado:",removeButton:"Remover",noCodeLinkedMessage:"Nenhum código QR vinculado a este conteúdo.",linkManuallyLabel:"Vincular manualmente",dialcodeInputPlaceholder:"Insira o dialcode (ex. A1B2C3)",dialcodeInputAriaLabel:"Campo de dialcode",linkButton:"Vincular",linkedSuccessMessage:"Dialcode vinculado com sucesso."},Z_={unitsAddedLabel:"Unidades adicionadas",contentItemsLabel:"Itens de conteúdo",progressLabel:"Progresso"},X_={dropOntoUnitError:"Solte sobre uma unidade para adicionar conteúdo",dropOntoCourseError:"Solte o conteúdo sobre uma unidade, não diretamente sobre o curso.",alreadyInCollectionError:'"{name}" já está nesta coleção',addedToUnitSuccess:'"{name}" adicionado à unidade',fillRequiredMetadataError:"Preencha os metadados obrigatórios",outlineAriaLabel:"Esquema do curso",showOutlineTitle:"Mostrar esquema",editorAriaLabel:"Editor de conteúdo",libraryAriaLabel:"Biblioteca de conteúdo",showLibraryTitle:"Mostrar biblioteca"},J_={draftStatusFallback:"Rascunho",backAriaLabel:"Voltar",statusAriaLabelPrefix:"Status:",savingIndicator:"Salvando…",unsavedIndicator:"Não salvo",savedIndicatorPrefix:"Salvo",fillRequiredFieldsTooltip:"Preencha todos os campos obrigatórios antes de salvar",saveAsDraftButton:"Salvar como rascunho",sendForReviewButton:"Enviar para revisão",collaboratorsLabel:"Colaboradores",qrCodesLabel:"Códigos QR",generatingEllipsis:"Gerando…",generateQrCodesMenuItem:"Gerar códigos QR",downloadingEllipsis:"Baixando…",downloadQrCodesMenuItem:"Baixar códigos QR",publishButton:"Publicar",requestForChangesButton:"Solicitar alterações",approveButton:"Aprovar",qrGenerationStartedToast:'Geração dos códigos QR iniciada. Use "Baixar códigos QR" quando estiverem prontos.',qrGenerationFailedToast:"Falha ao gerar os códigos QR. Tente novamente.",qrCodesNotGeneratedToast:"Nenhum código QR gerado ainda. Gere os códigos QR primeiro.",qrGenerationInProgressToast:"A geração das imagens dos códigos QR está em andamento. Tente baixar novamente mais tarde.",qrCodesNotReadyToast:"Os códigos QR ainda não estão prontos. Aguarde e tente novamente.",qrCodesDownloadedToast:"Códigos QR baixados.",qrCodesDownloadFailedToast:"Falha ao baixar os códigos QR.",requestChangesTitle:"Solicitar alterações",changesRequestedLabel:"Alterações solicitadas",describeChangesPlaceholder:"Descreva as alterações que o autor precisa fazer"},ew={closeAriaLabel:"Fechar",fillCommentsError:"Preencha os comentários",cancelButton:"Cancelar"},tw={closeAriaLabel:"Fechar",title:"Aceitar Termos e Condições",agreementTextPart1:"Concordo que, ao enviar/publicar este Conteúdo, confirmo que ele está em conformidade com as diretrizes estabelecidas, incluindo os Termos de Uso e a Política de Conteúdo, e que consinto em publicá-lo sob a",creativeCommonsLinkText:"Estrutura Creative Commons",agreementTextPart2:"de acordo com a",contentPolicyText:"Política de Conteúdo",agreementTextPart3:". Certifiquei-me de que não violo direitos de autor ou de privacidade de terceiros.",cancelButton:"Cancelar",submitButton:"Enviar"},rw={closeAriaLabel:"Fechar",title:"Gerar códigos QR",numberOfCodesLabel:"Número de códigos QR",countPlaceholder:"Insira um número (2–250)",countRangeError:"Insira um número entre 2 e 250.",cancelButton:"Cancelar",generateButton:"Gerar"},nw={remove:"Remover"},sw={dropHere:"Solte aqui"},ow={loading:"Carregando"},aw={profileBadgeLabel:"Trilha de Aprendizagem",pathStructureLabel:"Estrutura da trilha",addLevelButton:"Adicionar nível",levelNumberPrefix:"Nível {n}",priorAssessmentLabel:"Avaliação prévia",priorAssessmentHint:"Sempre obrigatória · não conta como um nível",outcomeAssessmentLabel:"Avaliação de resultado",outcomeAssessmentHint:"Confirma o resultado · não conta como um nível",skillCheckBadge:"Verificação de habilidade",outcomeCheckBadge:"Verificação de resultado",assessmentCourseMeta:"Curso · Apenas banco de questões",addAssessmentSlotButton:"Adicionar {label} — um curso com apenas um banco de questões",addCourseToLevelButton:"Adicionar um curso da Biblioteca",addLevelExamButton:"Adicionar Exame de nível — um curso com apenas um banco de questões",levelExamMeta:"Exame de nível · Apenas banco de questões",requiredSlotBadge:"Obrigatório",removeAssessmentSlotButton:"Remover",deletePriorAssessmentConfirm:"Excluir a Avaliação prévia remove a pontuação usada pelos avanços adaptativos deste percurso. Continuar?",deleteAssessmentSlotConfirm:"Remover este curso de avaliação do percurso?",deleteLevelExamConfirm:"Remover este curso de Exame de nível do nível?",deleteLevelConfirm:'Excluir "{name}" e tudo o que ele contém?',deleteCourseConfirm:"Remover este curso do percurso?",deleteMultipleConfirm:"Excluir os {count} itens selecionados do percurso?",courseNameUnavailable:"Detalhes do curso indisponíveis",notAssessmentCourseToast:'"{name}" não é um Curso de Avaliação, portanto não pode ser usado como avaliação.',bothSlotsFilledToast:"As avaliações prévia e de resultado já estão preenchidas.",levelExamAlreadyFilledToast:"Este nível já tem um curso de Exame de nível — remova-o antes de adicionar outro.",assessmentCheckFailedToast:"Não foi possível verificar este curso. Tente novamente.",skillsHeading:"Habilidades desenvolvidas neste nível",skillsCoveredHeading:"Habilidades obtidas com esta trilha",skillsCoveredDescription:"Os alunos obtêm essas habilidades ao concluir a trilha. Reúne as habilidades ensinadas pelos cursos de cada nível, mais a Avaliação Prévia e a Avaliação Final.",noSkillsYet:"Nenhuma habilidade ainda — adicione aos níveis cursos marcados com habilidades para vê-las aqui.",levelCountLabel:"{count} nível",levelCountLabelPlural:"{count} níveis",courseCountLabel:"{count} curso",courseCountLabelPlural:"{count} cursos",backToPathButton:"Voltar ao percurso",backToLevelButton:"Voltar a {label}",courseDetailsLoading:"Carregando detalhes do curso…",courseDetailsEmpty:"Este curso ainda não tem unidades.",courseDetailsError:"Não foi possível carregar os detalhes do curso.",courseDetailsCardTitle:"Detalhes do curso",courseTitleFieldLabel:"Título",courseDescriptionFieldLabel:"Descrição",noCourseDescriptionPlaceholder:"Nenhuma descrição disponível.",unitsSectionLabel:"Unidades",unitsSectionDescription:"As unidades agrupam conteúdo relacionado; cada item de conteúdo é marcado com as habilidades que desenvolve.",unitTopicsFieldLabel:"Tópicos",contentCountLabel:"{count} conteúdo",contentCountLabelPlural:"{count} conteúdos",courseUnitTopicsLabel:"{count} tópico",courseUnitTopicsLabelPlural:"{count} tópicos",verifyingAssessmentCourses:"Verificando cursos de avaliação…",resolveBeforePublishing:"Resolva os itens abaixo antes de publicar:",resolveBeforeSendingForReview:"Resolva os itens abaixo antes de enviar para revisão:",assessmentsCardHeading:"Avaliações prévia e de resultado",assessmentsCardDescription:"Adicione os cursos compostos apenas por banco de questões que abrem e encerram este percurso.",assessmentNotAddedYet:"Ainda não adicionado — escolha um curso composto apenas por banco de questões na Biblioteca.",viewCourseMenuItem:"Ver",priorAssessmentExplainerTitle:"Por que isso não pode ser pulado",priorAssessmentExplainerBody:"A pontuação deste banco de questões é o que cada nível usa para decidir um avanço — ainda não há nada para comparar, então ele sempre é executado por completo.",priorAssessmentPurposeLabel:"Define a linha de base de habilidades",outcomeAssessmentExplainerTitle:"Encerra o percurso",outcomeAssessmentExplainerBody:"Passar neste banco de questões certifica o ganho de habilidade de todo o percurso — sua pontuação é o que aparece no certificado do aprendiz.",outcomeUnlocksHint:"Desbloqueia após o último nível",assessmentCourseSectionTitle:"Curso",assessmentCourseSectionDescription:"Um único Curso de Avaliação — seu conteúdo só pode ser Bancos de Questões ou Avaliação de Curso, nunca outros tipos de conteúdo.",libraryOpenLevelToAdd:"Abra um nível para adicionar",libraryAddToLevel:"Adicionar a {level}",libraryAddPriorAssessmentCourse:"Adicionar curso de Avaliação prévia",libraryAddOutcomeAssessmentCourse:"Adicionar curso de Avaliação de resultado",libraryAddLevelExamCourse:"Adicionar curso de Exame de nível para {level}",policyStrictLabel:"Estrita",policyStrictDescription:"Todo aprendiz completa todos os níveis, em ordem — independentemente da pontuação da avaliação prévia.",policyAdaptiveLabel:"Adaptativa",policyAdaptiveDescriptionPre:"Um nível pode ser pulado, mas somente quando a pontuação do aprendiz na Avaliação prévia",policyAdaptiveDescriptionPost:" atinge o limite de dispensa.",policyPriorLearningLabel:"Aprendizagem prévia",policyPriorLearningDescription:"Os avanços também podem se basear em habilidades que o aprendiz já possui — um certificado verificado ou curso anterior — não apenas na avaliação.",selectLevelFirstToast:"Selecione um nível primeiro",selectLevelFromOutlineToast:"Abra um nível na estrutura da trilha para adicionar cursos — cursos não podem ser adicionados à própria trilha nem dentro de outro curso.",selectCurriculumFirstToast:"Selecione um Currículo ou uma estrutura de habilidades para esta trilha antes de adicionar cursos.",noCurriculumEmptyTitle:"Nenhum Currículo ou estrutura de habilidades selecionado",noCurriculumEmptyHint:"Selecione um Currículo ou uma estrutura de habilidades para esta trilha para navegar pelos cursos.",itemAlreadyInPathToast:'"{name}" já está nesta trilha de aprendizagem',addedToLevelSuccess:'"{name}" adicionado ao nível',dropOntoLevelError:"Solte sobre um nível para adicionar um curso",dropOntoPathError:"Solte os cursos sobre um nível, não diretamente na trilha de aprendizagem.",priorSlotFilledToast:"A Avaliação prévia já tem um curso — remova-o antes de adicionar outro.",outcomeSlotFilledToast:"A Avaliação final já tem um curso — remova-o antes de adicionar outro.",levelNeedsMixedContentToast:"Este nível é o primeiro ou o último no percurso — um curso composto apenas por bancos de questões como único conteúdo será tratado como uma Avaliação prévia/final. Adicione outro curso, ou um curso com mais do que apenas bancos de questões.",cannotRemoveLastRegularCourseToast:"Este nível é o primeiro ou o último no percurso — remover este curso deixaria apenas o curso de Exame de Nível, que seria tratado como uma Avaliação prévia/final. Adicione outro curso primeiro.",coursesRemovedFrameworkChangeToast:"{count} curso(s) vinculados a outro currículo foram removidos desta trilha.",levelSkillsResetFrameworkChangeToast:"{count} nível(is) tiveram as habilidades selecionadas apagadas — elas não se aplicam ao novo currículo.",priorAssessmentNarrowedScopeToast:"A Avaliação prévia reduziu o escopo de habilidades — {count} nível(is) agora têm habilidades fora dele.",coursesCardHeading:"Cursos",coursesCardDescription:"Cursos que o aluno conclui para passar deste nível. Arraste a alça para reordenar e use o menu para remover.",coursesEmptyHint:"Nenhum curso ainda.",courseMetaLabel:"Curso",removeFromLevelMenuItem:"Remover do nível",courseNotTeachingRoleBadge:"Ensina habilidades fora desta função",roleChangedCoursesFlaggedToast:"{count} curso(s) ensinam habilidades fora da nova função. Eles foram mantidos e sinalizados — remova-os antes de enviar para revisão.",priorAssessmentMissingRoleSkills:"A Avaliação prévia não testa estas habilidades da função: {skills}",skillFrameworkChangedToast:"Estrutura de habilidades alterada: a função-alvo e as habilidades da trilha foram limpas.",roleSkillsCoveredDescription:"As habilidades da função-alvo. Os alunos as obtêm ao concluir a trilha. Cada uma deve ser ensinada por um curso antes que a trilha possa ser enviada para revisão.",roleSkillNotTaughtSuffix:"ainda não ensinada",roleSkillTaughtSuffix:"✓",roleSkillNotTaughtTitle:"Nenhum curso desta trilha ensina esta habilidade ainda",roleSkillTaughtTitle:"Um curso desta trilha ensina esta habilidade",levelSkillsFromCoursesNote:"Obtidas a partir dos cursos deste nível. Adicione ou remova cursos para alterá-las.",levelSkillsEmpty:"Nenhuma habilidade ainda — adicione um curso a este nível.",levelSkillsOutsidePrior:"Estas habilidades não são avaliadas pela Avaliação Prévia: {skills}. Remova o curso que as ensina."},iw={contextualEditor:d_,languageSelector:f_,collectionEditor:h_,breadcrumb:p_,tabBar:m_,contentEditForm:g_,titleAppIcon:v_,unitContentList:y_,contentRow:b_,csvUpload:C_,manageCollaborators:S_,sparkMetaForm:x_,appIconField:__,appIconPickerModal:w_,chipGroupField:T_,dateTimeField:E_,dialcodeInputField:k_,keywordSuggestField:A_,licenseSelectField:L_,multiSelectField:I_,nestedSelectField:D_,radioField:j_,selectField:O_,textField:N_,assetBrowser:R_,resourceReorderDialog:P_,assignPageNumber:F_,confirmDialog:M_,publishChecklist:B_,qualityParamsModal:q_,unsavedChangesModal:$_,filterChips:U_,libraryCard:V_,libraryDock:H_,libraryFilterPanel:z_,libraryPreviewPanel:Q_,outlineTree:W_,treeNode:G_,contentPlayer:K_,dialcodePanel:Y_,progressStatus:Z_,splitBuilderShell:X_,topbar:J_,reviewCommentModal:ew,confirmReviewModal:tw,generateQRModal:rw,chip:nw,dropZone:sw,spinner:ow,learningPath:aw},lw=["ar"],cw={en:fl,ar:hx,fr:u_,pt:iw};function Bh(e,t){const r={...e};for(const n of Object.keys(t)){const s=e[n],o=t[n];s&&o&&typeof s=="object"&&typeof o=="object"&&!Array.isArray(s)&&!Array.isArray(o)?r[n]=Bh(s,o):o!==void 0&&(r[n]=o)}return r}function xu(e){const t=cw[e];return!t||e==="en"?fl:Bh(fl,t)}function uw(e){return lw.includes(e)}const hl="app-language",pl="app-language-change",tc=xo(e=>({lang:"en",labelConfig:xu("en"),setLanguage:(t,r={})=>{e({lang:t,labelConfig:xu(t)}),localStorage.setItem(hl,t),document.documentElement.setAttribute("dir",uw(t)?"rtl":"ltr"),document.documentElement.setAttribute("lang",t),r.broadcast!==!1&&window.dispatchEvent(new CustomEvent(pl,{detail:{lang:t}}))}}));function qh(e,t){return function(){return e.apply(t,arguments)}}const{toString:dw}=Object.prototype,{getPrototypeOf:ys}=Object,{iterator:_o,toStringTag:$h}=Symbol,ba=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),no=(e,t)=>{let r=e;const n=[];for(;r!=null&&r!==Object.prototype;){if(n.indexOf(r)!==-1)return!1;if(n.push(r),ba(r,t))return!0;r=ys(r)}return!1},fw=(e,t)=>e!=null&&no(e,t)?e[t]:void 0,rc=(e=>t=>{const r=dw.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Er=e=>(e=e.toLowerCase(),t=>rc(t)===e),Qa=e=>t=>typeof t===e,{isArray:qn}=Array,bs=Qa("undefined");function As(e){return e!==null&&!bs(e)&&e.constructor!==null&&!bs(e.constructor)&&Zt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Uh=Er("ArrayBuffer");function hw(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Uh(e.buffer),t}const pw=Qa("string"),Zt=Qa("function"),Vh=Qa("number"),Ls=e=>e!==null&&typeof e=="object",mw=e=>e===!0||e===!1,Yo=e=>{if(!Ls(e))return!1;const t=ys(e);return(t===null||t===Object.prototype||ys(t)===null)&&!no(e,$h)&&!no(e,_o)},gw=e=>{if(!Ls(e)||As(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},vw=Er("Date"),yw=Er("File"),bw=e=>!!(e&&typeof e.uri<"u"),Cw=e=>e&&typeof e.getParts<"u",Sw=Er("Blob"),xw=Er("FileList"),_w=e=>Ls(e)&&Zt(e.pipe);function ww(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const _u=ww(),wu=typeof _u.FormData<"u"?_u.FormData:void 0,Tw=e=>{if(!e)return!1;if(wu&&e instanceof wu)return!0;const t=ys(e);if(!t||t===Object.prototype||!Zt(e.append))return!1;const r=rc(e);return r==="formdata"||r==="object"&&Zt(e.toString)&&e.toString()==="[object FormData]"},Ew=Er("URLSearchParams"),[kw,Aw,Lw,Iw]=["ReadableStream","Request","Response","Headers"].map(Er),Dw=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wo(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),qn(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(As(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(n=0;n<a;n++)i=o[n],t.call(null,e[i],i,e)}}function Hh(e,t){if(As(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const En=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,zh=e=>!bs(e)&&e!==En;function ml(...e){const{caseless:t,skipUndefined:r}=zh(this)&&this||{},n={},s=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const i=t&&typeof a=="string"&&Hh(n,a)||a,c=ba(n,i)?n[i]:void 0;Yo(c)&&Yo(o)?n[i]=ml(c,o):Yo(o)?n[i]=ml({},o):qn(o)?n[i]=o.slice():(!r||!bs(o))&&(n[i]=o)};for(let o=0,a=e.length;o<a;o++){const i=e[o];if(!i||As(i)||(wo(i,s),typeof i!="object"||qn(i)))continue;const c=Object.getOwnPropertySymbols(i);for(let u=0;u<c.length;u++){const d=c[u];Vw.call(i,d)&&s(i[d],d)}}return n}const jw=(e,t,r,{allOwnKeys:n}={})=>(wo(t,(s,o)=>{r&&Zt(s)?Object.defineProperty(e,o,{__proto__:null,value:qh(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),Ow=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Nw=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},Rw=(e,t,r,n)=>{let s,o,a;const i={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!n||n(a,e,t))&&!i[a]&&(t[a]=e[a],i[a]=!0);e=r!==!1&&ys(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},Pw=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},Fw=e=>{if(!e)return null;if(qn(e))return e;let t=e.length;if(!Vh(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},Mw=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ys(Uint8Array)),Bw=(e,t)=>{const n=(e&&e[_o]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},qw=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},$w=Er("HTMLFormElement"),Uw=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),{propertyIsEnumerable:Vw}=Object.prototype,Hw=Er("RegExp"),Qh=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};wo(r,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(n[o]=a||s)}),Object.defineProperties(e,n)},zw=e=>{Qh(e,(t,r)=>{if(Zt(e)&&["arguments","caller","callee"].includes(r))return!1;const n=e[r];if(Zt(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Qw=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return qn(e)?n(e):n(String(e).split(t)),r},Ww=()=>{},Gw=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Kw(e){return!!(e&&Zt(e.append)&&e[$h]==="FormData"&&e[_o])}const Yw=e=>{const t=new WeakSet,r=n=>{if(Ls(n)){if(t.has(n))return;if(As(n))return n;if(!("toJSON"in n)){t.add(n);const s=qn(n)?[]:{};return wo(n,(o,a)=>{const i=r(o);!bs(i)&&(s[a]=i)}),t.delete(n),s}}return n};return r(e)},Zw=Er("AsyncFunction"),Xw=e=>e&&(Ls(e)||Zt(e))&&Zt(e.then)&&Zt(e.catch),Wh=((e,t)=>e?setImmediate:t?((r,n)=>(En.addEventListener("message",({source:s,data:o})=>{s===En&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),En.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",Zt(En.postMessage)),Jw=typeof queueMicrotask<"u"?queueMicrotask.bind(En):typeof process<"u"&&process.nextTick||Wh,Gh=e=>e!=null&&Zt(e[_o]),eT=e=>e!=null&&no(e,_o)&&Gh(e),L={isArray:qn,isArrayBuffer:Uh,isBuffer:As,isFormData:Tw,isArrayBufferView:hw,isString:pw,isNumber:Vh,isBoolean:mw,isObject:Ls,isPlainObject:Yo,isEmptyObject:gw,isReadableStream:kw,isRequest:Aw,isResponse:Lw,isHeaders:Iw,isUndefined:bs,isDate:vw,isFile:yw,isReactNativeBlob:bw,isReactNative:Cw,isBlob:Sw,isRegExp:Hw,isFunction:Zt,isStream:_w,isURLSearchParams:Ew,isTypedArray:Mw,isFileList:xw,forEach:wo,merge:ml,extend:jw,trim:Dw,stripBOM:Ow,inherits:Nw,toFlatObject:Rw,kindOf:rc,kindOfTest:Er,endsWith:Pw,toArray:Fw,forEachEntry:Bw,matchAll:qw,isHTMLForm:$w,hasOwnProperty:ba,hasOwnProp:ba,hasOwnInPrototypeChain:no,getSafeProp:fw,reduceDescriptors:Qh,freezeMethods:zw,toObjectSet:Qw,toCamelCase:Uw,noop:Ww,toFiniteNumber:Gw,findKey:Hh,global:En,isContextDefined:zh,isSpecCompliantForm:Kw,toJSONObject:Yw,isAsyncFn:Zw,isThenable:Xw,setImmediate:Wh,asap:Jw,isIterable:Gh,isSafeIterable:eT},tT=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),rT=e=>{const t={};let r,n,s;return e&&e.split(`
529
+ `).forEach(function(a){s=a.indexOf(":"),r=a.substring(0,s).trim().toLowerCase(),n=a.substring(s+1).trim(),!(!r||t[r]&&tT[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t};function nT(e){let t=0,r=e.length;for(;t<r;){const n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;r>t;){const n=e.charCodeAt(r-1);if(n!==9&&n!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}const sT=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oT=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function nc(e,t){return L.isArray(e)?e.map(r=>nc(r,t)):nT(String(e).replace(t,""))}const aT=e=>nc(e,sT),iT=e=>nc(e,oT);function Kh(e){const t=Object.create(null);return L.forEach(e.toJSON(),(r,n)=>{t[n]=iT(r)}),t}const Tu=Symbol("internals");function Rs(e){return e&&String(e).trim().toLowerCase()}function Zo(e){return e===!1||e==null?e:L.isArray(e)?e.map(Zo):aT(String(e))}function lT(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const cT=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function vi(e,t,r,n,s){if(L.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!L.isString(t)){if(L.isString(n))return t.indexOf(n)!==-1;if(L.isRegExp(n))return n.test(t)}}function uT(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function dT(e,t){const r=L.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{__proto__:null,value:function(s,o,a){return this[n].call(this,t,s,o,a)},configurable:!0})})}let Bt=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(i,c,u){const d=Rs(c);if(!d)return;const f=L.findKey(s,d);(!f||s[f]===void 0||u===!0||u===void 0&&s[f]!==!1)&&(s[f||c]=Zo(i))}const a=(i,c)=>L.forEach(i,(u,d)=>o(u,d,c));if(L.isPlainObject(t)||t instanceof this.constructor)a(t,r);else if(L.isString(t)&&(t=t.trim())&&!cT(t))a(rT(t),r);else if(L.isObject(t)&&L.isSafeIterable(t)){let i=Object.create(null),c,u;for(const d of t){if(!L.isArray(d))throw new TypeError("Object iterator must return a key-value pair");u=d[0],L.hasOwnProp(i,u)?(c=i[u],i[u]=L.isArray(c)?[...c,d[1]]:[c,d[1]]):i[u]=d[1]}a(i,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=Rs(t),t){const n=L.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return lT(s);if(L.isFunction(r))return r.call(this,s,n);if(L.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Rs(t),t){const n=L.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||vi(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(a){if(a=Rs(a),a){const i=L.findKey(n,a);i&&(!r||vi(n,n[i],i,r))&&(delete n[i],s=!0)}}return L.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||vi(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return L.forEach(this,(s,o)=>{const a=L.findKey(n,o);if(a){r[a]=Zo(s),delete r[o];return}const i=t?uT(o):String(o).trim();i!==o&&delete r[o],r[i]=Zo(s),n[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return L.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&L.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
530
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[Tu]=this[Tu]={accessors:{}}).accessors,s=this.prototype;function o(a){const i=Rs(a);n[i]||(dT(s,a),n[i]=!0)}return L.isArray(t)?t.forEach(o):o(t),this}};Bt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);L.reduceDescriptors(Bt.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});L.freezeMethods(Bt);const fT="[REDACTED ****]";function hT(e){if(L.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(L.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function pT(e,t){const r=new Set(t.map(o=>String(o).toLowerCase())),n=[],s=o=>{if(o===null||typeof o!="object"||L.isBuffer(o))return o;if(n.indexOf(o)!==-1)return;o instanceof Bt&&(o=o.toJSON()),n.push(o);let a;if(L.isArray(o))a=[],o.forEach((i,c)=>{const u=s(i);L.isUndefined(u)||(a[c]=u)});else{if(!L.isPlainObject(o)&&hT(o))return n.pop(),o;a=Object.create(null);for(const[i,c]of Object.entries(o)){const u=r.has(i.toLowerCase())?fT:s(c);L.isUndefined(u)||(a[i]=u)}}return n.pop(),a};return s(e)}let oe=class Yh extends Error{static from(t,r,n,s,o,a){const i=new Yh(t.message,r||t.code,n,s,o);return i.cause=t,i.name=t.name,t.status!=null&&i.status==null&&(i.status=t.status),a&&Object.assign(i,a),i}constructor(t,r,n,s,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,r=t&&L.hasOwnProp(t,"redact")?t.redact:void 0,n=L.isArray(r)&&r.length>0?pT(t,r):L.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:n,code:this.code,status:this.status}}};oe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";oe.ERR_BAD_OPTION="ERR_BAD_OPTION";oe.ECONNABORTED="ECONNABORTED";oe.ETIMEDOUT="ETIMEDOUT";oe.ECONNREFUSED="ECONNREFUSED";oe.ERR_NETWORK="ERR_NETWORK";oe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";oe.ERR_DEPRECATED="ERR_DEPRECATED";oe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";oe.ERR_BAD_REQUEST="ERR_BAD_REQUEST";oe.ERR_CANCELED="ERR_CANCELED";oe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";oe.ERR_INVALID_URL="ERR_INVALID_URL";oe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const mT=null,Zh=100;function gl(e){return L.isPlainObject(e)||L.isArray(e)}function Xh(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function yi(e,t,r){return e?e.concat(t).map(function(s,o){return s=Xh(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function gT(e){return L.isArray(e)&&!e.some(gl)}const vT=L.toFlatObject(L,{},null,function(t){return/^is[A-Z]/.test(t)});function Wa(e,t,r){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=L.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,S){return!L.isUndefined(S[C])});const n=r.metaTokens,s=r.visitor||b,o=r.dots,a=r.indexes,i=r.Blob||typeof Blob<"u"&&Blob,c=r.maxDepth===void 0?Zh:r.maxDepth,u=i&&L.isSpecCompliantForm(t),d=[];if(!L.isFunction(s))throw new TypeError("visitor must be a function");function f(y){if(y===null)return"";if(L.isDate(y))return y.toISOString();if(L.isBoolean(y))return y.toString();if(!u&&L.isBlob(y))throw new oe("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(y)||L.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function m(y){if(y>c)throw new oe("Object is too deeply nested ("+y+" levels). Max depth: "+c,oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function h(y,C){if(c===1/0)return JSON.stringify(y);const S=[];return JSON.stringify(y,function(_,w){if(!L.isObject(w))return w;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(w),m(C+S.length-1),w})}function b(y,C,S){let x=y;if(L.isReactNative(t)&&L.isReactNativeBlob(y))return t.append(yi(S,C,o),f(y)),!1;if(y&&!S&&typeof y=="object"){if(L.endsWith(C,"{}"))C=n?C:C.slice(0,-2),y=h(y,1);else if(L.isArray(y)&&gT(y)||(L.isFileList(y)||L.endsWith(C,"[]"))&&(x=L.toArray(y)))return C=Xh(C),x.forEach(function(w,E){!(L.isUndefined(w)||w===null)&&t.append(a===!0?yi([C],E,o):a===null?C:C+"[]",f(w))}),!1}return gl(y)?!0:(t.append(yi(S,C,o),f(y)),!1)}const p=Object.assign(vT,{defaultVisitor:b,convertValue:f,isVisitable:gl});function v(y,C,S=0){if(!L.isUndefined(y)){if(m(S),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+C.join("."));d.push(y),L.forEach(y,function(_,w){(!(L.isUndefined(_)||_===null)&&s.call(t,_,L.isString(w)?w.trim():w,C,p))===!0&&v(_,C?C.concat(w):[w],S+1)}),d.pop()}}if(!L.isObject(e))throw new TypeError("data must be an object");return v(e),t}function Eu(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(n){return t[n]})}function sc(e,t){this._pairs=[],e&&Wa(e,this,t)}const Jh=sc.prototype;Jh.append=function(t,r){this._pairs.push([t,r])};Jh.toString=function(t){const r=t?function(n){return t.call(this,n,Eu)}:Eu;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function yT(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ep(e,t,r){if(!t)return e;const n=L.isFunction(r)?{serialize:r}:r,s=L.getSafeProp(n,"encode")||yT,o=L.getSafeProp(n,"serialize");let a;if(o?a=o(t,n):a=L.isURLSearchParams(t)?t.toString():new sc(t,n).toString(s),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class ku{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){L.forEach(this.handlers,function(n){n!==null&&t(n)})}}const oc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},bT=typeof URLSearchParams<"u"?URLSearchParams:sc,CT=typeof FormData<"u"?FormData:null,ST=typeof Blob<"u"?Blob:null,xT={isBrowser:!0,classes:{URLSearchParams:bT,FormData:CT,Blob:ST},protocols:["http","https","file","blob","url","data"]},ac=typeof window<"u"&&typeof document<"u",vl=typeof navigator=="object"&&navigator||void 0,_T=ac&&(!vl||["ReactNative","NativeScript","NS"].indexOf(vl.product)<0),wT=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",TT=ac&&window.location.href||"http://localhost",ET=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ac,hasStandardBrowserEnv:_T,hasStandardBrowserWebWorkerEnv:wT,navigator:vl,origin:TT},Symbol.toStringTag,{value:"Module"})),At={...ET,...xT};function kT(e,t){return Wa(e,new At.classes.URLSearchParams,{visitor:function(r,n,s,o){return At.isNode&&L.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const Au=Zh;function tp(e){if(e>Au)throw new oe("FormData field is too deeply nested ("+e+" levels). Max depth: "+Au,oe.ERR_FORM_DATA_DEPTH_EXCEEDED)}function AT(e){const t=[],r=/\w+|\[(\w*)]/g;let n;for(;(n=r.exec(e))!==null;)tp(t.length),t.push(n[0]==="[]"?"":n[1]||n[0]);return t}function LT(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function rp(e){function t(r,n,s,o){tp(o);let a=r[o++];if(a==="__proto__")return!0;const i=Number.isFinite(+a),c=o>=r.length;return a=!a&&L.isArray(s)?s.length:a,c?(L.hasOwnProp(s,a)?s[a]=L.isArray(s[a])?s[a].concat(n):[s[a],n]:s[a]=n,!i):((!L.hasOwnProp(s,a)||!L.isObject(s[a]))&&(s[a]=[]),t(r,n,s[a],o)&&L.isArray(s[a])&&(s[a]=LT(s[a])),!i)}if(L.isFormData(e)&&L.isFunction(e.entries)){const r={};return L.forEachEntry(e,(n,s)=>{t(AT(n),s,r,0)}),r}return null}const Hn=(e,t)=>e!=null&&L.hasOwnProp(e,t)?e[t]:void 0;function IT(e,t,r){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const To={transitional:oc,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=L.isObject(t);if(o&&L.isHTMLForm(t)&&(t=new FormData(t)),L.isFormData(t))return s?JSON.stringify(rp(t)):t;if(L.isArrayBuffer(t)||L.isBuffer(t)||L.isStream(t)||L.isFile(t)||L.isBlob(t)||L.isReadableStream(t))return t;if(L.isArrayBufferView(t))return t.buffer;if(L.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){const c=Hn(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return kT(t,c).toString();if((i=L.isFileList(t))||n.indexOf("multipart/form-data")>-1){const u=Hn(this,"env"),d=u&&u.FormData;return Wa(i?{"files[]":t}:t,d&&new d,c)}}return o||s?(r.setContentType("application/json",!1),IT(t)):t}],transformResponse:[function(t){const r=Hn(this,"transitional")||To.transitional,n=r&&r.forcedJSONParsing,s=Hn(this,"responseType"),o=s==="json";if(L.isResponse(t)||L.isReadableStream(t))return t;if(t&&L.isString(t)&&(n&&!s||o)){const i=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(t,Hn(this,"parseReviver"))}catch(c){if(i)throw c.name==="SyntaxError"?oe.from(c,oe.ERR_BAD_RESPONSE,this,null,Hn(this,"response")):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:At.classes.FormData,Blob:At.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};L.forEach(["delete","get","head","post","put","patch","query"],e=>{To.headers[e]={}});function bi(e,t){const r=this||To,n=t||r,s=Bt.from(n.headers);let o=n.data;return L.forEach(e,function(i){o=i.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function np(e){return!!(e&&e.__CANCEL__)}let Eo=class extends oe{constructor(t,r,n){super(t??"canceled",oe.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function sp(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new oe("Request failed with status code "+r.status,r.status>=400&&r.status<500?oe.ERR_BAD_REQUEST:oe.ERR_BAD_RESPONSE,r.config,r.request,r))}function DT(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function jT(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=n[o];a||(a=u),r[s]=c,n[s]=u;let f=o,m=0;for(;f!==s;)m+=r[f++],f=f%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-a<t)return;const h=d&&u-d;return h?Math.round(m*1e3/h):void 0}}function OT(e,t){let r=0,n=1e3/t,s,o;const a=(u,d=Date.now())=>{r=d,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-r;f>=n?a(u,d):(s=u,o||(o=setTimeout(()=>{o=null,a(s)},n-f)))},()=>s&&a(s)]}const Ca=(e,t,r=3)=>{let n=0;const s=jT(50,250);return OT(o=>{if(!o||typeof o.loaded!="number")return;const a=o.loaded,i=o.lengthComputable?o.total:void 0,c=i!=null?Math.min(a,i):a,u=Math.max(0,c-n),d=s(u);n=Math.max(n,c);const f={loaded:c,total:i,progress:i?c/i:void 0,bytes:u,rate:d||void 0,estimated:d&&i?(i-c)/d:void 0,event:o,lengthComputable:i!=null,[t?"download":"upload"]:!0};e(f)},r)},Lu=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Iu=e=>(...t)=>L.asap(()=>e(...t)),NT=At.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,At.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(At.origin),At.navigator&&/(msie|trident)/i.test(At.navigator.userAgent)):()=>!0,RT=At.hasStandardBrowserEnv?{write(e,t,r,n,s,o,a){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(t)}`];L.isNumber(r)&&i.push(`expires=${new Date(r).toUTCString()}`),L.isString(n)&&i.push(`path=${n}`),L.isString(s)&&i.push(`domain=${s}`),o===!0&&i.push("secure"),L.isString(a)&&i.push(`SameSite=${a}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;r<t.length;r++){const n=t[r].replace(/^\s+/,""),s=n.indexOf("=");if(s!==-1&&n.slice(0,s)===e)return decodeURIComponent(n.slice(s+1))}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function PT(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function FT(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}const MT=/^https?:(?!\/\/)/i,BT=/[\t\n\r]/g;function qT(e){let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t)}function $T(e){return qT(e).replace(BT,"")}function Du(e,t){if(typeof e=="string"&&MT.test($T(e)))throw new oe('Invalid URL: missing "//" after protocol',oe.ERR_INVALID_URL,t)}function op(e,t,r,n){Du(t,n);let s=!PT(t);return e&&(s||r===!1)?(Du(e,n),FT(e,t)):t}const ju=e=>e instanceof Bt?{...e}:e;function $n(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function n(d,f,m,h){return L.isPlainObject(d)&&L.isPlainObject(f)?L.merge.call({caseless:h},d,f):L.isPlainObject(f)?L.merge({},f):L.isArray(f)?f.slice():f}function s(d,f,m,h){if(L.isUndefined(f)){if(!L.isUndefined(d))return n(void 0,d,m,h)}else return n(d,f,m,h)}function o(d,f){if(!L.isUndefined(f))return n(void 0,f)}function a(d,f){if(L.isUndefined(f)){if(!L.isUndefined(d))return n(void 0,d)}else return n(void 0,f)}function i(d){const f=L.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!L.isUndefined(f))if(L.isPlainObject(f)){if(L.hasOwnProp(f,d))return f[d]}else return;const m=L.hasOwnProp(e,"transitional")?e.transitional:void 0;if(L.isPlainObject(m)&&L.hasOwnProp(m,d))return m[d]}function c(d,f,m){if(L.hasOwnProp(t,m))return n(d,f);if(L.hasOwnProp(e,m))return n(void 0,d)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:c,headers:(d,f,m)=>s(ju(d),ju(f),m,!0)};return L.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const m=L.hasOwnProp(u,f)?u[f]:s,h=L.hasOwnProp(e,f)?e[f]:void 0,b=L.hasOwnProp(t,f)?t[f]:void 0,p=m(h,b,f);L.isUndefined(p)&&m!==c||(r[f]=p)}),L.hasOwnProp(t,"validateStatus")&&L.isUndefined(t.validateStatus)&&i("validateStatusUndefinedResolves")===!1&&(L.hasOwnProp(e,"validateStatus")?r.validateStatus=n(void 0,e.validateStatus):delete r.validateStatus),r}const UT=["content-type","content-length"];function VT(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([n,s])=>{UT.includes(n.toLowerCase())&&e.set(n,s)})}const HT=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16)));function ap(e){const t=$n({},e),r=m=>L.hasOwnProp(t,m)?t[m]:void 0,n=r("data");let s=r("withXSRFToken");const o=r("xsrfHeaderName"),a=r("xsrfCookieName");let i=r("headers");const c=r("auth"),u=r("baseURL"),d=r("allowAbsoluteUrls"),f=r("url");if(t.headers=i=Bt.from(i),t.url=ep(op(u,f,d,t),r("params"),r("paramsSerializer")),c){const m=L.getSafeProp(c,"username")||"",h=L.getSafeProp(c,"password")||"";i.set("Authorization","Basic "+btoa(m+":"+(h?HT(h):"")))}if(L.isFormData(n)&&(At.hasStandardBrowserEnv||At.hasStandardBrowserWebWorkerEnv||L.isReactNative(n)?i.setContentType(void 0):L.isFunction(n.getHeaders)&&VT(i,n.getHeaders(),r("formDataHeaderPolicy"))),At.hasStandardBrowserEnv&&(L.isFunction(s)&&(s=s(t)),s===!0||s==null&&NT(t.url))){const h=o&&a&&RT.read(a);h&&i.set(o,h)}return t}const zT=typeof XMLHttpRequest<"u",QT=zT&&function(e){return new Promise(function(r,n){const s=ap(e);let o=s.data;const a=Bt.from(s.headers).normalize();let{responseType:i,onUploadProgress:c,onDownloadProgress:u}=s,d,f,m,h,b;function p(){h&&h(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let v=new XMLHttpRequest;v.open(s.method.toUpperCase(),s.url,!0),v.timeout=s.timeout;function y(){if(!v)return;const S=Bt.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders()),_={data:!i||i==="text"||i==="json"?v.responseText:v.response,status:v.status,statusText:v.statusText,headers:S,config:e,request:v};sp(function(E){r(E),p()},function(E){n(E),p()},_),v=null}"onloadend"in v?v.onloadend=y:v.onreadystatechange=function(){!v||v.readyState!==4||v.status===0&&!(v.responseURL&&v.responseURL.startsWith("file:"))||setTimeout(y)},v.onabort=function(){v&&(n(new oe("Request aborted",oe.ECONNABORTED,e,v)),p(),v=null)},v.onerror=function(x){const _=x&&x.message?x.message:"Network Error",w=new oe(_,oe.ERR_NETWORK,e,v);w.event=x||null,n(w),p(),v=null},v.ontimeout=function(){let x=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||oc;s.timeoutErrorMessage&&(x=s.timeoutErrorMessage),n(new oe(x,_.clarifyTimeoutError?oe.ETIMEDOUT:oe.ECONNABORTED,e,v)),p(),v=null},o===void 0&&a.setContentType(null),"setRequestHeader"in v&&L.forEach(Kh(a),function(x,_){v.setRequestHeader(_,x)}),L.isUndefined(s.withCredentials)||(v.withCredentials=!!s.withCredentials),i&&i!=="json"&&(v.responseType=s.responseType),u&&([m,b]=Ca(u,!0),v.addEventListener("progress",m)),c&&v.upload&&([f,h]=Ca(c),v.upload.addEventListener("progress",f),v.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(d=S=>{v&&(n(!S||S.type?new Eo(null,e,v):S),v.abort(),p(),v=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const C=DT(s.url);if(C&&!At.protocols.includes(C)){n(new oe("Unsupported protocol "+C+":",oe.ERR_BAD_REQUEST,e));return}v.send(o||null)})},WT=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const r=new AbortController;let n=!1;const s=function(c){if(!n){n=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof oe?u:new Eo(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,s(new oe(`timeout of ${t}ms exceeded`,oe.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(s):c.removeEventListener("abort",s)}),e=null)};e.forEach(c=>c.addEventListener("abort",s));const{signal:i}=r;return i.unsubscribe=()=>L.asap(a),i},GT=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},KT=async function*(e,t){for await(const r of YT(e))yield*GT(r,t)},YT=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},Ou=(e,t,r,n)=>{const s=KT(e,t);let o=0,a,i=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){i(),c.close();return}let f=d.byteLength;if(r){let m=o+=f;r(m)}c.enqueue(new Uint8Array(d))}catch(u){throw i(u),u}},cancel(c){return i(c),s.return()}},{highWaterMark:2})},Sa=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,ZT=(e,t,r)=>t+2<r&&Sa(e.charCodeAt(t+1))&&Sa(e.charCodeAt(t+2));function XT(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(r)){let a=n.length;const i=n.length;for(let h=0;h<i;h++)if(n.charCodeAt(h)===37&&h+2<i){const b=n.charCodeAt(h+1),p=n.charCodeAt(h+2);Sa(b)&&Sa(p)&&(a-=2,h+=2)}let c=0,u=i-1;const d=h=>h>=2&&n.charCodeAt(h-2)===37&&n.charCodeAt(h-1)===51&&(n.charCodeAt(h)===68||n.charCodeAt(h)===100);u>=0&&(n.charCodeAt(u)===61?(c++,u--):d(u)&&(c++,u-=3)),c===1&&u>=0&&(n.charCodeAt(u)===61||d(u))&&c++;const m=Math.floor(a/4)*3-(c||0);return m>0?m:0}let o=0;for(let a=0,i=n.length;a<i;a++){const c=n.charCodeAt(a);if(c===37&&ZT(n,a,i))o+=1,a+=2;else if(c<128)o+=1;else if(c<2048)o+=2;else if(c>=55296&&c<=56319&&a+1<i){const u=n.charCodeAt(a+1);u>=56320&&u<=57343?(o+=4,a++):o+=3}else o+=3}return o}const ic="1.18.0",Nu=64*1024,{isFunction:Fo}=L,JT=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),Ru=e=>{if(!L.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Pu=(e,...t)=>{try{return!!e(...t)}catch{return!1}},e0=e=>{const t=e.indexOf("://");let r=e;return t!==-1&&(r=r.slice(t+3)),r.includes("@")||r.includes(":")},t0=e=>{const t=L.global!==void 0&&L.global!==null?L.global:globalThis,{ReadableStream:r,TextEncoder:n}=t;e=L.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:s,Request:o,Response:a}=e,i=s?Fo(s):typeof fetch=="function",c=Fo(o),u=Fo(a);if(!i)return!1;const d=i&&Fo(r),f=i&&(typeof n=="function"?(y=>C=>y.encode(C))(new n):async y=>new Uint8Array(await new o(y).arrayBuffer())),m=c&&d&&Pu(()=>{let y=!1;const C=new o(At.origin,{body:new r,method:"POST",get duplex(){return y=!0,"half"}}),S=C.headers.has("Content-Type");return C.body!=null&&C.body.cancel(),y&&!S}),h=u&&d&&Pu(()=>L.isReadableStream(new a("").body)),b={stream:h&&(y=>y.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!b[y]&&(b[y]=(C,S)=>{let x=C&&C[y];if(x)return x.call(C);throw new oe(`Response type '${y}' is not supported`,oe.ERR_NOT_SUPPORT,S)})});const p=async y=>{if(y==null)return 0;if(L.isBlob(y))return y.size;if(L.isSpecCompliantForm(y))return(await new o(At.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(L.isArrayBufferView(y)||L.isArrayBuffer(y))return y.byteLength;if(L.isURLSearchParams(y)&&(y=y+""),L.isString(y))return(await f(y)).byteLength},v=async(y,C)=>{const S=L.toFiniteNumber(y.getContentLength());return S??p(C)};return async y=>{let{url:C,method:S,data:x,signal:_,cancelToken:w,timeout:E,onDownloadProgress:k,onUploadProgress:N,responseType:F,headers:I,withCredentials:R="same-origin",fetchOptions:P,maxContentLength:O,maxBodyLength:V}=ap(y);const ne=L.isNumber(O)&&O>-1,W=L.isNumber(V)&&V>-1,ue=B=>L.hasOwnProp(y,B)?y[B]:void 0;let ie=s||fetch;F=F?(F+"").toLowerCase():"text";let ve=WT([_,w&&w.toAbortSignal()],E),me=null;const H=ve&&ve.unsubscribe&&(()=>{ve.unsubscribe()});let be,Te=null;const $=()=>new oe("Request body larger than maxBodyLength limit",oe.ERR_BAD_REQUEST,y,me);try{let B;const le=ue("auth");if(le){const G=L.getSafeProp(le,"username")||"",U=L.getSafeProp(le,"password")||"";B={username:G,password:U}}if(e0(C)){const G=new URL(C,At.origin);if(!B&&(G.username||G.password)){const U=Ru(G.username),Ee=Ru(G.password);B={username:U,password:Ee}}(G.username||G.password)&&(G.username="",G.password="",C=G.href)}if(B&&(I.delete("authorization"),I.set("Authorization","Basic "+btoa(JT((B.username||"")+":"+(B.password||""))))),ne&&typeof C=="string"&&C.startsWith("data:")&&XT(C)>O)throw new oe("maxContentLength size of "+O+" exceeded",oe.ERR_BAD_RESPONSE,y,me);if(W&&S!=="get"&&S!=="head"){const G=await p(x);if(typeof G=="number"&&isFinite(G)&&(be=G,G>V))throw $()}const ge=W&&(L.isReadableStream(x)||L.isStream(x)),J=(G,U,Ee)=>Ou(G,Nu,we=>{if(W&&we>V)throw Te=$();U&&U(we)},Ee);if(m&&S!=="get"&&S!=="head"&&(N||ge)){if(be=be??await v(I,x),be!==0||ge){let G=new o(C,{method:"POST",body:x,duplex:"half"}),U;if(L.isFormData(x)&&(U=G.headers.get("content-type"))&&I.setContentType(U),G.body){const[Ee,we]=N&&Lu(be,Ca(Iu(N)))||[];x=J(G.body,Ee,we)}}}else if(ge&&!c&&d&&S!=="get"&&S!=="head")x=J(x);else if(ge&&c&&!m&&S!=="get"&&S!=="head")throw new oe("Stream request bodies are not supported by the current fetch implementation",oe.ERR_NOT_SUPPORT,y,me);L.isString(R)||(R=R?"include":"omit");const de=c&&"credentials"in o.prototype;if(L.isFormData(x)){const G=I.getContentType();G&&/^multipart\/form-data/i.test(G)&&!/boundary=/i.test(G)&&I.delete("content-type")}I.set("User-Agent","axios/"+ic,!1);const X={...P,signal:ve,method:S.toUpperCase(),headers:Kh(I.normalize()),body:x,duplex:"half",credentials:de?R:void 0};me=c&&new o(C,X);let Ce=await(c?ie(me,P):ie(C,X));const Ne=Bt.from(Ce.headers);if(ne){const G=L.toFiniteNumber(Ne.getContentLength());if(G!=null&&G>O)throw new oe("maxContentLength size of "+O+" exceeded",oe.ERR_BAD_RESPONSE,y,me)}const re=h&&(F==="stream"||F==="response");if(h&&Ce.body&&(k||ne||re&&H)){const G={};["status","statusText","headers"].forEach(Pe=>{G[Pe]=Ce[Pe]});const U=L.toFiniteNumber(Ne.getContentLength()),[Ee,we]=k&&Lu(U,Ca(Iu(k),!0))||[];let ke=0;const xe=Pe=>{if(ne&&(ke=Pe,ke>O))throw new oe("maxContentLength size of "+O+" exceeded",oe.ERR_BAD_RESPONSE,y,me);Ee&&Ee(Pe)};Ce=new a(Ou(Ce.body,Nu,xe,()=>{we&&we(),H&&H()}),G)}F=F||"text";let ce=await b[L.findKey(b,F)||"text"](Ce,y);if(ne&&!h&&!re){let G;if(ce!=null&&(typeof ce.byteLength=="number"?G=ce.byteLength:typeof ce.size=="number"?G=ce.size:typeof ce=="string"&&(G=typeof n=="function"?new n().encode(ce).byteLength:ce.length)),typeof G=="number"&&G>O)throw new oe("maxContentLength size of "+O+" exceeded",oe.ERR_BAD_RESPONSE,y,me)}return!re&&H&&H(),await new Promise((G,U)=>{sp(G,U,{data:ce,headers:Bt.from(Ce.headers),status:Ce.status,statusText:Ce.statusText,config:y,request:me})})}catch(B){if(H&&H(),ve&&ve.aborted&&ve.reason instanceof oe){const le=ve.reason;throw le.config=y,me&&(le.request=me),B!==le&&(le.cause=B),le}throw Te?(me&&!Te.request&&(Te.request=me),Te):B instanceof oe?(me&&!B.request&&(B.request=me),B):B&&B.name==="TypeError"&&/Load failed|fetch/i.test(B.message)?Object.assign(new oe("Network Error",oe.ERR_NETWORK,y,me,B&&B.response),{cause:B.cause||B}):oe.from(B,B&&B.code,y,me,B&&B.response)}}},r0=new Map,ip=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let a=o.length,i=a,c,u,d=r0;for(;i--;)c=o[i],u=d.get(c),u===void 0&&d.set(c,u=i?new Map:t0(t)),d=u;return u};ip();const lc={http:mT,xhr:QT,fetch:{get:ip}};L.forEach(lc,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const Fu=e=>`- ${e}`,n0=e=>L.isFunction(e)||e===null||e===!1;function s0(e,t){e=L.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let a=0;a<r;a++){n=e[a];let i;if(s=n,!n0(n)&&(s=lc[(i=String(n)).toLowerCase()],s===void 0))throw new oe(`Unknown adapter '${i}'`);if(s&&(L.isFunction(s)||(s=s.get(t))))break;o[i||"#"+a]=s}if(!s){const a=Object.entries(o).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=r?a.length>1?`since :
531
+ `+a.map(Fu).join(`
532
+ `):" "+Fu(a[0]):"as no adapter specified";throw new oe("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return s}const lp={getAdapter:s0,adapters:lc};function Ci(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Eo(null,e)}function Mu(e){return Ci(e),e.headers=Bt.from(e.headers),e.data=bi.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),lp.getAdapter(e.adapter||To.adapter,e)(e).then(function(n){Ci(e),e.response=n;try{n.data=bi.call(e,e.transformResponse,n)}finally{delete e.response}return n.headers=Bt.from(n.headers),n},function(n){if(!np(n)&&(Ci(e),n&&n.response)){e.response=n.response;try{n.response.data=bi.call(e,e.transformResponse,n.response)}finally{delete e.response}n.response.headers=Bt.from(n.response.headers)}return Promise.reject(n)})}const Ga={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ga[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Bu={};Ga.transitional=function(t,r,n){function s(o,a){return"[Axios v"+ic+"] Transitional option '"+o+"'"+a+(n?". "+n:"")}return(o,a,i)=>{if(t===!1)throw new oe(s(a," has been removed"+(r?" in "+r:"")),oe.ERR_DEPRECATED);return r&&!Bu[a]&&(Bu[a]=!0,console.warn(s(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,a,i):!0}};Ga.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function o0(e,t,r){if(typeof e!="object")throw new oe("options must be an object",oe.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const i=e[o],c=i===void 0||a(i,o,e);if(c!==!0)throw new oe("option "+o+" must be "+c,oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new oe("Unknown option "+o,oe.ERR_BAD_OPTION)}}const Xo={assertOptions:o0,validators:Ga},jt=Xo.validators;let Mn=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ku,response:new ku}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=(()=>{if(!s.stack)return"";const a=s.stack.indexOf(`
533
+ `);return a===-1?"":s.stack.slice(a+1)})();try{if(!n.stack)n.stack=o;else if(o){const a=o.indexOf(`
534
+ `),i=a===-1?-1:o.indexOf(`
535
+ `,a+1),c=i===-1?"":o.slice(i+1);String(n.stack).endsWith(c)||(n.stack+=`
536
+ `+o)}}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=$n(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Xo.assertOptions(n,{silentJSONParsing:jt.transitional(jt.boolean),forcedJSONParsing:jt.transitional(jt.boolean),clarifyTimeoutError:jt.transitional(jt.boolean),legacyInterceptorReqResOrdering:jt.transitional(jt.boolean),advertiseZstdAcceptEncoding:jt.transitional(jt.boolean),validateStatusUndefinedResolves:jt.transitional(jt.boolean)},!1),s!=null&&(L.isFunction(s)?r.paramsSerializer={serialize:s}:Xo.assertOptions(s,{encode:jt.function,serialize:jt.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Xo.assertOptions(r,{baseUrl:jt.spelling("baseURL"),withXsrfToken:jt.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=o&&L.merge(o.common,o[r.method]);o&&L.forEach(["delete","get","head","post","put","patch","query","common"],b=>{delete o[b]}),r.headers=Bt.concat(a,o);const i=[];let c=!0;this.interceptors.request.forEach(function(p){if(typeof p.runWhen=="function"&&p.runWhen(r)===!1)return;c=c&&p.synchronous;const v=r.transitional||oc;v&&v.legacyInterceptorReqResOrdering?i.unshift(p.fulfilled,p.rejected):i.push(p.fulfilled,p.rejected)});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,f=0,m;if(!c){const b=[Mu.bind(this),void 0];for(b.unshift(...i),b.push(...u),m=b.length,d=Promise.resolve(r);f<m;)d=d.then(b[f++],b[f++]);return d}m=i.length;let h=r;for(;f<m;){const b=i[f++],p=i[f++];try{h=b(h)}catch(v){p.call(this,v);break}}try{d=Mu.call(this,h)}catch(b){return Promise.reject(b)}for(f=0,m=u.length;f<m;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=$n(this.defaults,t);const r=op(t.baseURL,t.url,t.allowAbsoluteUrls,t);return ep(r,t.params,t.paramsSerializer)}};L.forEach(["delete","get","head","options"],function(t){Mn.prototype[t]=function(r,n){return this.request($n(n||{},{method:t,url:r,data:n&&L.hasOwnProp(n,"data")?n.data:void 0}))}});L.forEach(["post","put","patch","query"],function(t){function r(n){return function(o,a,i){return this.request($n(i||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Mn.prototype[t]=r(),t!=="query"&&(Mn.prototype[t+"Form"]=r(!0))});let a0=class cp{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(i=>{n.subscribe(i),o=i}).then(s);return a.cancel=function(){n.unsubscribe(o)},a},t(function(o,a,i){n.reason||(n.reason=new Eo(o,a,i),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new cp(function(s){t=s}),cancel:t}}};function i0(e){return function(r){return e.apply(null,r)}}function l0(e){return L.isObject(e)&&e.isAxiosError===!0}const yl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(yl).forEach(([e,t])=>{yl[t]=e});function up(e){const t=new Mn(e),r=qh(Mn.prototype.request,t);return L.extend(r,Mn.prototype,t,{allOwnKeys:!0}),L.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return up($n(e,s))},r}const it=up(To);it.Axios=Mn;it.CanceledError=Eo;it.CancelToken=a0;it.isCancel=np;it.VERSION=ic;it.toFormData=Wa;it.AxiosError=oe;it.Cancel=it.CanceledError;it.all=function(t){return Promise.all(t)};it.spread=i0;it.isAxiosError=l0;it.mergeConfig=$n;it.AxiosHeaders=Bt;it.formToJSON=e=>rp(L.isHTMLForm(e)?new FormData(e):e);it.getAdapter=lp.getAdapter;it.HttpStatusCode=yl;it.default=it;const{Axios:NU,AxiosError:RU,CanceledError:PU,isCancel:FU,CancelToken:MU,VERSION:BU,all:qU,Cancel:$U,isAxiosError:UU,spread:VU,toFormData:HU,AxiosHeaders:zU,HttpStatusCode:QU,formToJSON:WU,getAdapter:GU,mergeConfig:KU,create:YU}=it;let bl="";function dp(e){bl=e}const Ue=it.create({timeout:3e4});function c0(e,t){if(!e||typeof t!="string"||!t.trim())return e;const r=t.trim().replace(/\/+$/,""),n=r.startsWith("/")?r:`/${r}`;return e.replace(/^\/(action|api|portal)(?=\/|$)/,n)}Ue.interceptors.request.use(async e=>{var s,o,a;const{useEditorStore:t}=await Promise.resolve().then(()=>CC),r=t.getState(),n=(s=r.editorConfig)==null?void 0:s.context;return e.headers=e.headers??{},n!=null&&n.authToken&&(e.headers.Authorization=`Bearer ${n.authToken}`),n!=null&&n.userToken&&(e.headers["X-Authenticated-User-Token"]=n.userToken),n!=null&&n.channel&&(e.headers["X-Channel-Id"]=n.channel),e.url=c0(e.url,(a=(o=r.editorConfig)==null?void 0:o.config)==null?void 0:a.apiSlug),bl&&(e.baseURL=bl),e});const fp="/portal";async function hp(e){var n,s,o,a,i,c,u;const t=await Ue.get(`${fp}/questionset/v2/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.questionset;if(!r||!r.identifier){const d=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No questionset returned for "${e}"`;throw new Error(`Unable to load questionset hierarchy: ${d}`)}return r}async function u0(e){var r,n;return e.length?((n=(r=(await Ue.post(`${fp}/question/v2/list`,{request:{search:{identifier:e}}})).data)==null?void 0:r.result)==null?void 0:n.questions)??[]:[]}function Ka(e,t){const r=e??{},n=r.identifier??"",s=r.objectType??"",o=r.mimeType??"",a=r.children,i=Array.isArray(a)?a.map(u=>Ka(u,n)):[],c=o==="application/vnd.ekstep.content-collection"||s.toLowerCase().includes("unit")||s.toLowerCase().includes("textbook")||s.toLowerCase().includes("collection")||s.toLowerCase().includes("course")||s.toLowerCase().includes("lesson")||r.visibility==="Parent"||o==="application/vnd.sunbird.questionset"&&i.length>0;return{id:n,identifier:n,name:r.name??"Untitled",title:r.name??"Untitled",description:r.description,primaryCategory:r.primaryCategory,mimeType:r.mimeType,objectType:s,contentType:r.contentType,visibility:r.visibility,status:r.status,appIcon:r.appIcon,isFolder:c,children:i,metadata:r,parent:t}}async function pp(e){var s,o,a,i,c,u,d;const t=await Ue.get(`/action/collection/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(o=(s=t.data)==null?void 0:s.result)==null?void 0:o.content;if(!r||!r.identifier){const f=((i=(a=t.data)==null?void 0:a.params)==null?void 0:i.errmsg)||((u=(c=t.data)==null?void 0:c.params)==null?void 0:u.err)||((d=t.data)==null?void 0:d.responseCode)||`No content returned for "${e}"`;throw new Error(`Unable to load hierarchy: ${f}`)}const n=Ka(r);return{content:r,rootNode:n}}async function d0(e){const t=await hp(e),r=Ka(t);return{content:t,rootNode:r}}async function f0(e,t,r,n){var o;return((o=(await Ue.patch("/action/collection/v1/hierarchy/update",{request:{data:{nodesModified:t,hierarchy:r,...n?{lastUpdatedBy:n}:{}}}})).data)==null?void 0:o.result)??{}}async function h0(e,t=""){await Ue.post(`/action/collection/v1/publish/${e}`,{request:{content:{lastPublishedBy:t}}})}async function p0(e){var n,s,o,a,i,c,u;const t=await Ue.get(`/action/course/v1/hierarchy/${e}`,{params:{mode:"edit"}}),r=(s=(n=t.data)==null?void 0:n.result)==null?void 0:s.content;if(!r||!r.identifier){const d=((a=(o=t.data)==null?void 0:o.params)==null?void 0:a.errmsg)||((c=(i=t.data)==null?void 0:i.params)==null?void 0:c.err)||((u=t.data)==null?void 0:u.responseCode)||`No course returned for "${e}"`;throw new Error(`Unable to load course hierarchy: ${d}`)}return r}async function mp(e){var r,n;return(n=(r=(await Ue.get(`/action/collection/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.content}async function m0(e){await Ue.post(`/action/collection/v1/review/${e}`,{request:{content:{}}})}async function g0(e,t){await Ue.post(`/action/collection/v1/reject/${e}`,{request:{content:{rejectComment:t}}})}async function v0(e,t){await Ue.patch(`/action/content/v1/collaborator/update/${e}`,{request:{content:{collaborators:t}}})}function so(e,t){if(!(t!=null&&t.length))return;const r=t.find(s=>s.code===e);if(r)return r;const n=e.toLowerCase();return t.find(s=>{var o;return((o=s.name)==null?void 0:o.toLowerCase())===n})}function y0(e,t){var r;return((r=so(e,t))==null?void 0:r.code)??e}function Sn(e,t){const r=Array.isArray(e)?e:e!=null&&e!==""?[e]:[];return Array.from(new Set(r.map(n=>y0(String(n),t))))}function Ya(e,t){var r;return((r=so(e,t))==null?void 0:r.name)??e}function xa(e,t){return Array.from(new Set(e.flatMap(r=>{const n=so(r,t);return n?[n.code,n.name]:[r]})))}const ir="competencyFramework",wn="targetRole",gp="skill";function vp(e,t,r){var o,a;if(!e)return;const n=(o=t[e.id])==null?void 0:o[r],s=n!==void 0?n:(a=e.metadata)==null?void 0:a[r];return typeof s=="string"&&s?s:void 0}function Za(e,t){return vp(e,t,ir)}function b0(e,t){return vp(e,t,wn)}function Cs(e,t=gp,r){const n=e&&"metadata"in e?e.metadata:e;return Sn(n==null?void 0:n[t],r)}function cc(e,t){const r=new Set(t);return e.filter(n=>!r.has(n))}function yp(e){return(e.children??[]).filter(t=>!ot(t)).flatMap(t=>t.children??[]).filter(t=>{var r;return!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function bp(e,t,r,n){return!e||!t.length?[]:yp(e).filter(s=>cc(Cs(s,r,n),t).length>0)}function Cp(e,t,r,n){if(!e||!t.length)return[];const s=new Set(yp(e).flatMap(o=>Cs(o,r,n)));return t.filter(o=>!s.has(o))}const uc="Evaluation Course";function ss(e){return(e==null?void 0:e.primaryCategory)===uc}function C0(e){const t=(e.children??[]).map(r=>({...r,children:(r.children??[]).map(n=>{var o;const s=!!((o=n.metadata)!=null&&o.isAssessmentCourse)||ss(n.metadata);return{...n,isFolder:!1,children:[],metadata:{...n.metadata??{},...s?{isAssessmentCourse:!0}:{}}}})}));return{...e,children:t}}function ot(e){var r,n;const t=(e==null?void 0:e.children)??[];return t.length===1&&!!((n=(r=t[0])==null?void 0:r.metadata)!=null&&n.isAssessmentCourse)}function Sp(e){var r,n;const t=(r=e==null?void 0:e.children)==null?void 0:r[0];return ot(t)?(n=t==null?void 0:t.children)==null?void 0:n[0]:void 0}function xp(e){return((e==null?void 0:e.children)??[]).find(t=>{var r;return!!((r=t.metadata)!=null&&r.isAssessmentCourse)})}function S0(e,t,r){return r?e===0?"pre":e===t-1?"post":"levelAssessment":"content"}function x0(e,t){const r=e.findIndex(s=>s.id===t);return r===-1?null:ao(e,r)?{role:r===0?"pre":"post",levelNumber:null}:{role:"level",levelNumber:e.slice(0,r+1).filter((s,o)=>!ao(e,o)).length}}function oo(e,t){return t==="pre"?e.length>0&&ot(e[0]):e.length>1&&ot(e[e.length-1])}function ao(e,t){const r=S0(t,e.length,ot(e[t]));return r==="pre"||r==="post"}function Cl(e,t){const r=t?e.findIndex(n=>n.id===t.id):-1;return r!==-1&&ao(e,r)}function qu(e,t){var n,s;return(((n=e[0])==null?void 0:n.id)===t.id||((s=e[e.length-1])==null?void 0:s.id)===t.id)&&(t.children??[]).length===0}function _0(e){return oo(e,"pre")?oo(e,"post")?null:"post":"pre"}function w0(e,t,r){if(t<0||t>=e.length)return!1;const n=ot(e[0])?e[0]:null,s=e.length>1&&ot(e[e.length-1])?e[e.length-1]:null,o=[...e],[a]=o.splice(t,1);return o.splice(r,0,a),!(n&&o[0]!==n||s&&o[o.length-1]!==s||!n&&ot(o[0])||!s&&o.length>1&&ot(o[o.length-1]))}function $u(e,t,r){return r?!1:t?!((e==null?void 0:e.children)??[]).some(s=>{var o;return!!((o=s.metadata)!=null&&o.isAssessmentCourse)}):!0}function _p(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}function wp(e,t){var n,s;return e?((n=t[e.id])==null?void 0:n.framework)??((s=e.metadata)==null?void 0:s.framework):void 0}function Tp(e,t){return!!wp(e,t)}function Ep(e,t,r=[]){if(!e||!t)return[];const n=new Set,s=e.children??[];return s.forEach((o,a)=>{var i;ao(s,a)?Sn((i=o.children[0].metadata)==null?void 0:i[t],r).forEach(c=>n.add(c)):ko(o,t,r).forEach(c=>n.add(c))}),Array.from(n)}function ko(e,t,r=[]){var s,o;if(!e||!t)return[];const n=new Set;for(const a of e.children??[])(s=a.metadata)!=null&&s.isAssessmentCourse||Sn((o=a.metadata)==null?void 0:o[t],r).forEach(i=>n.add(i));return Array.from(n)}function T0(e,t,r,n=[],s=[]){var f,m;if(!e||!t)return null;const o=s.length?[...s]:Ep(e,t,n),a=((f=r[e.id])==null?void 0:f[t])??((m=e.metadata)==null?void 0:m[t]),i=_p(a),c=[...o].sort(),u=[...i].sort();return c.length===u.length&&c.every((h,b)=>h===u[b])?null:o}function E0(e,t,r,n=[]){if(!e||!t||r.length===0)return[];const s=e.children??[];return s.filter((o,a)=>ao(s,a)?!1:ko(o,t,n).some(i=>!r.includes(i)))}const kp=new Set(["adaptive"]);function dc(e,t,r,n={},s=[],o=[]){var y,C,S;const a=x=>x.map(_=>Ya(_,s)).join(", "),i=[];if(!e)return i;const c=((y=n[e.id])==null?void 0:y.policy)??((C=e.metadata)==null?void 0:C.policy);c||i.push({code:"policyMissing",message:"Set a consumption policy for this path."});const u=e.children??[],d=u[0],f=u.length>1?u[u.length-1]:void 0,m=ot(d),h=ot(f);!m&&c&&kp.has(c)&&i.push({code:"priorAssessmentRequired",message:"A Prior Assessment is required for the Adaptive policy."}),[[d,"Prior Assessment"],[f,"Outcome Assessment"]].forEach(([x,_])=>{if(!x)return;const w=x.children??[],E=w.filter(k=>{var N;return!!((N=k.metadata)!=null&&N.isAssessmentCourse)});E.length!==0&&(E.length<w.length||w.length!==1&&i.push({code:"slotNotPure",nodeId:x.id,message:`${_} must contain exactly one question-set-only course.`}))});const b=new Set,p=(x,_)=>{b.has(x)&&i.push({code:"duplicateCourse",nodeId:_,message:"A course appears more than once in this path."}),b.add(x)},v=u.slice(m?1:0,u.length-(h?1:0));m&&p(d.children[0].id,d.id),h&&p(f.children[0].id,f.id);for(const x of v){const _=x.children??[];if(_.length===0&&i.push({code:"emptyLevel",nodeId:x.id,message:`"${x.name}" has no courses yet.`}),!o.length&&r.length>0){const E=ko(x,t,s).filter(k=>!r.includes(k));E.length>0&&i.push({code:"levelSkillsOutOfScope",nodeId:x.id,message:`"${x.name}" has courses teaching skills outside the Prior Assessment: ${a(E)}.`})}for(const E of _)p(E.id,x.id),(t?_p((S=E.metadata)==null?void 0:S[t]):[]).length===0&&i.push({code:"courseMissingSkillTag",nodeId:E.id,message:`"${E.name}" has no skill tag.`})}if(o.length>0){for(const _ of bp(e,o,t,s)){const w=cc(Cs(_,t,s),o);i.push({code:"courseOutsideRole",nodeId:_.id,message:`"${_.name}" teaches skills outside the target role: ${a(w)}. Remove it from the path.`})}const x=Cp(e,o,t,s);x.length>0&&i.push({code:"roleSkillsNotTaught",message:`This path must teach every skill of the target role. Not taught yet: ${a(x)}.`})}return i}async function k0(e){const t=[],r=(e==null?void 0:e.children)??[],n=r[0],s=r.length>1?r[r.length-1]:void 0;for(const[o,a]of[[n,"Prior Assessment"],[s,"Outcome Assessment"]]){if(!o||!ot(o))continue;const i=o.children[0].id,c=await mp(i);ss(c)||t.push({code:"slotCourseChanged",nodeId:o.id,message:`${a}'s course is no longer an Evaluation Course — pick a different course.`})}return t}function Tt(e,t){const r=[...e];for(;r.length>0;){const n=r.shift();if(n.id===t)return n;n.children&&r.push(...n.children)}}function Ap(e,t,r=0){var n;for(const s of e){if(s.id===t)return r;if((n=s.children)!=null&&n.length){const o=Ap(s.children,t,r+1);if(o>=0)return o}}return-1}const Uu=new Set(["name","appIcon","description","keywords","trackable","qrCodeProcessId","reservedDialcodes"]);function Lp(e,t,r,n){return e.map(s=>{if(s.id===t){const o=r.metadata??{},a=n!=null&&n.length?new Set([...Uu,...n]):Uu,i={};for(const c of a)c in r&&(i[c]=r[c]);return{...s,...r,metadata:{...s.metadata??{},...i,...o}}}return s.children&&s.children.length>0?{...s,children:Lp(s.children,t,r,n)}:s})}function Jo(e,t,r){return e.map(n=>n.id===t?{...n,children:[...n.children??[],r]}:n.children&&n.children.length>0?{...n,children:Jo(n.children,t,r)}:n)}function Ip(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]];return o.splice(n,0,r),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:Ip(s.children,t,r,n)}:s})}function Sl(e,t){return e.filter(r=>r.id!==t).map(r=>({...r,children:r.children?Sl(r.children,t):[]}))}function xl(e,t,r,n){return e.map(s=>{if(s.id===t){const o=[...s.children??[]],[a]=o.splice(r,1);return o.splice(n,0,a),{...s,children:o}}return s.children&&s.children.length>0?{...s,children:xl(s.children,t,r,n)}:s})}function Dp(e,t){return e.map(r=>{const n=t[r.id]??r.id,s=r.parent?t[r.parent]??r.parent:r.parent;return{...r,id:n,identifier:n,parent:s,children:r.children?Dp(r.children,t):[]}})}function A0(e){let t=0;const r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t++,n.children&&r.push(...n.children)}return t}function L0(e,t){const r=Tt(e,t);if(!r)return[];const n=[];let s=r;for(;s;)n.unshift({id:s.id,name:s.name}),s=s.parent?Tt(e,s.parent):void 0;return n}const ae=xo((e,t)=>({treeData:[],selectedNodeId:null,treeCache:{},breadcrumb:[],activeNodeMeta:{},setTreeData:r=>{var s;const n=((s=r[0])==null?void 0:s.id)??null;e({treeData:r,selectedNodeId:n}),n&&setTimeout(()=>t().selectNode(n),0)},selectNode:r=>{const{treeData:n,treeCache:s,getBreadcrumb:o}=t(),a=Tt(n,r),i=o(r),c={...(a==null?void 0:a.metadata)??{},...s[r]??{}};Z.getState().setNodeFlags({isFolder:(a==null?void 0:a.isFolder)??!1,isRoot:!(a!=null&&a.parent),isQuml:!1}),at.getState().setActiveAssessmentSlot(null),e({selectedNodeId:r,breadcrumb:i,activeNodeMeta:c})},updateNode:(r,n,s,o)=>{var c;const a={...((c=Tt(t().treeData,r))==null?void 0:c.metadata)??{},...t().treeCache[r]??{}},i=Object.entries(n).some(([u,d])=>JSON.stringify(d)!==JSON.stringify(a[u]));if(e(u=>({treeData:Lp(u.treeData,r,n,s),treeCache:{...u.treeCache,[r]:{...u.treeCache[r]??{},...n}}})),t().selectedNodeId===r){const u=Tt(t().treeData,r);e(d=>({activeNodeMeta:{...(u==null?void 0:u.metadata)??{},...d.treeCache[r]??{}}}))}i&&!(o!=null&&o.silent)&&t().markDirty()},addNode:(r,n)=>{var m,h,b;const s=t(),o=Z.getState().editorProfile,a=((h=(m=Z.getState().editorConfig)==null?void 0:m.config)==null?void 0:h.maxDepth)??o.maxDepth,i=Ap(s.treeData,r);if(i>=a)return console.warn(`[tree.store] addNode: depth would exceed maxDepth (${a}). parentDepth=${i}`),"";const c="temp-"+Math.random().toString(36).slice(2),u={id:c,identifier:c,name:o.defaultUnitName,isFolder:!0,children:[],parent:r,metadata:{mimeType:"application/vnd.ekstep.content-collection",code:crypto.randomUUID(),name:o.defaultUnitName,contentType:o.unitContentType,primaryCategory:o.unitPrimaryCategory,visibility:"Parent"}},d=((b=Tt(s.treeData,r))==null?void 0:b.children)??[],f=o.derivedRoles&&oo(d,"post");return e(p=>({treeData:f?Ip(p.treeData,r,u,d.length-1):Jo(p.treeData,r,u),treeCache:{...p.treeCache,[c]:{...u.metadata,isNew:!0}}})),setTimeout(()=>t().selectNode(c),0),c},deleteNode:r=>{var o,a,i;const n=(o=t().treeData[0])==null?void 0:o.id;if(r===n)return!1;if(Z.getState().editorProfile.derivedRoles){const c=Tt(t().treeData,r),u=c!=null&&c.parent?Tt(t().treeData,c.parent):void 0,d=((a=t().treeData[0])==null?void 0:a.children)??[],f=u?d.findIndex(m=>m.id===u.id):-1;if(f===0||f===d.length-1){const m=(u.children??[]).filter(h=>h.id!==r);if(m.length===1&&((i=m[0].metadata)!=null&&i.isAssessmentCourse))return!1}}return e(c=>({treeData:Sl(c.treeData,r),selectedNodeId:c.selectedNodeId===r?null:c.selectedNodeId})),!0},reorderChildren:(r,n,s)=>{var i;const o=Z.getState().editorProfile,a=(i=t().treeData[0])==null?void 0:i.id;if(o.derivedRoles&&r===a){const c=Tt(t().treeData,r);if(c!=null&&c.children&&!w0(c.children,n,s))return}e(c=>({treeData:xl(c.treeData,r,n,s)}))},moveNode:(r,n,s)=>{var u,d,f;const o=Z.getState().editorProfile,a=Tt(t().treeData,r),i=Tt(t().treeData,s);if(!(i!=null&&i.isFolder))return;const c=(u=t().treeData[0])==null?void 0:u.id;if(!(o.derivedRoles&&(a!=null&&a.isFolder)&&s!==c)){if(o.derivedRoles&&a&&!a.isFolder){const m=!!((d=a.metadata)!=null&&d.isAssessmentCourse),h=((f=t().treeData[0])==null?void 0:f.children)??[];if(!$u(i,m,Cl(h,i)))return}e(m=>{const h=Tt(m.treeData,r);if(!h)return m;let b=Sl(m.treeData,r);return b=Jo(b,s,{...h,parent:s}),{treeData:b}}),t().markDirty()}},addResource:(r,n,s)=>{var b,p,v,y,C,S;const o=Z.getState().editorConfig,a=Z.getState().editorProfile,i=(b=t().treeData[0])==null?void 0:b.id,c=!!(s!=null&&s.isAssessmentCourse);if(a.derivedRoles&&n===i){if(!c||Tt(t().treeData,r.identifier))return!1;const x=t().treeData[0],_=(x==null?void 0:x.children)??[],w=(s==null?void 0:s.slot)??_0(_);if(!w||oo(_,w))return!1;const E=t().addNode(i,"unit");if(!E)return!1;const{learningPath:k}=tc.getState().labelConfig;if(t().updateNode(E,{name:w==="pre"?k.priorAssessmentLabel:k.outcomeAssessmentLabel}),w==="pre"){const N=(((v=(p=t().treeData[0])==null?void 0:p.children)==null?void 0:v.length)??1)-1;e(F=>({treeData:xl(F.treeData,i,N,0)}))}return t().addResource(r,E,s)}if(!(((y=o==null?void 0:o.config)==null?void 0:y.allowContentUnderRoot)??!1)&&n===i||Tt(t().treeData,r.identifier))return!1;const d=Tt(t().treeData,n);if(!(d!=null&&d.isFolder))return!1;if(a.derivedRoles){const x=((C=t().treeData[0])==null?void 0:C.children)??[];if(!$u(d,c,Cl(x,d)))return!1}const f=((S=o==null?void 0:o.config)==null?void 0:S.maxContentsLimit)??1200;if(A0(t().treeData)>=f)return!1;const h={id:r.identifier,identifier:r.identifier,name:r.name,isFolder:!1,children:[],parent:n,mimeType:r.mimeType,primaryCategory:r.primaryCategory,contentType:r.contentType,appIcon:r.appIcon,status:r.status,metadata:{...r,...c?{isAssessmentCourse:!0}:{}}};return e(x=>({treeData:Jo(x.treeData,n,h)})),t().markDirty(),!0},markDirty:()=>{const{editorMode:r,setIsDirty:n}=Z.getState();r==="edit"&&n(!0)},pruneCoursesByFramework:r=>{let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a=[];for(const i of o.children??[]){const c=ot(i),u=(i.children??[]).filter(d=>{var h;if(d.isFolder)return!0;const f=(h=d.metadata)==null?void 0:h.framework,m=!f||(Array.isArray(f)?f.includes(r):f===r);return m||n++,m});c&&u.length===0||a.push(u.length===(i.children??[]).length?i:{...i,children:u})}return n===0?s:{treeData:[{...o,children:a}]}}),n>0&&t().markDirty(),n},clearLevelSkills:r=>{if(!r)return 0;let n=0;return e(s=>{const o=s.treeData[0];if(!o)return s;const a={...s.treeCache},i=(o.children??[]).map(c=>{var m,h;if(!(((m=c.metadata)==null?void 0:m[r])!==void 0||((h=a[c.id])==null?void 0:h[r])!==void 0))return c;n++;const{[r]:d,...f}=c.metadata??{};if(a[c.id]){const{[r]:b,...p}=a[c.id];a[c.id]=p}return{...c,metadata:f}});return n===0?s:{treeData:[{...o,children:i}],treeCache:a}}),n>0&&t().markDirty(),n},replaceNodeIds:r=>{!r||Object.keys(r).length===0||e(n=>{const s=Dp(n.treeData,r),o={};for(const[i,c]of Object.entries(n.treeCache)){const u=r[i]??i,{isNew:d,...f}=c;o[u]=f}const a=n.selectedNodeId?r[n.selectedNodeId]??n.selectedNodeId:null;return{treeData:s,treeCache:o,selectedNodeId:a}})},getNodeById:r=>Tt(t().treeData,r),getChildrenOf:r=>{const n=Tt(t().treeData,r);return(n==null?void 0:n.children)??[]},getBreadcrumb:r=>L0(t().treeData,r)})),I0="_spin_1ah4d_9",D0={spin:I0};function fe(){return tc(e=>e.labelConfig)}const j0=({size:e=16,color:t="currentColor"})=>{const r=fe();return l.jsx("svg",{className:D0.spin,width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-label":r.spinner.loading,role:"status",children:l.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeDasharray:"31.4",strokeDashoffset:"10",strokeLinecap:"round"})})},ze=({variant:e="ghost",size:t="md",isLoading:r,disabled:n,onClick:s,children:o,className:a,type:i="button"})=>l.jsxs("button",{type:i,className:`sbx-btn-${e} ${t==="sm"?"sbx-btn-sm":""} ${a??""}`,onClick:s,disabled:r||n,"aria-busy":r?!0:void 0,children:[r?l.jsx(j0,{size:14}):null,o]}),jp=({size:e=16,...t})=>l.jsxs("svg",{width:e,height:e,viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[l.jsx("circle",{cx:"58",cy:"12",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("circle",{cx:"8",cy:"58",r:"4",stroke:"currentColor",strokeWidth:"4"}),l.jsx("path",{d:"M52 12 H24 A12 12 0 0 0 24 36 H40 A12 12 0 0 1 40 60 H12",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]});async function Vu(e){var r,n;return(n=(r=(await Ue.get(`/action/framework/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function O0(e){var r,n;return((n=(r=(await Ue.post("/action/composite/v3/search",{request:{filters:{objectType:"Framework",status:["Live"],...e.type?{type:e.type}:{},...e.identifier?{identifier:e.identifier}:{},...e.channel?{channel:e.channel}:{},...e.systemDefault?{systemDefault:e.systemDefault}:{}}}})).data)==null?void 0:r.result)==null?void 0:n.Framework)??[]}function Xa(e,t){const r=zr({queryKey:["framework",e],queryFn:()=>Vu(e),enabled:!!e,staleTime:3e5}),n=t==null?void 0:t[0],s=zr({queryKey:["framework",n],queryFn:()=>Vu(n),enabled:!!n,staleTime:300*1e3}),o=s.data?[s.data]:[];return{organisationFramework:r.data,targetFrameworks:o,isLoading:r.isLoading||s.isLoading}}async function N0(e){var n,s;return(((s=(n=(await Ue.post("/action/composite/v3/search",{request:{filters:{objectType:["CompetencyFramework"],status:["Live"],...e?{channel:[e]}:{}},fields:["identifier","name"],limit:100,sort_by:{name:"asc"}}})).data)==null?void 0:n.result)==null?void 0:s.CompetencyFramework)??[]).map(o=>({identifier:o.identifier,name:o.name||o.identifier}))}async function R0(e){var r,n;return(n=(r=(await Ue.get(`/action/competency-framework/v3/read/${encodeURIComponent(e)}`)).data)==null?void 0:r.result)==null?void 0:n.framework}async function P0(e){var t,r;try{const s=((t=(await Ue.get(`/action/competency/v1/role/list/${encodeURIComponent(e)}`)).data)==null?void 0:t.result)??{};return Object.entries(s.roles??{}).map(([o,a])=>{var i;return{id:o,name:((i=s.roleNames)==null?void 0:i[o])||o,skills:a??[]}}).sort((o,a)=>o.name.localeCompare(a.name))}catch(n){if(((r=n.response)==null?void 0:r.status)===404)return[];throw n}}function Op(e){var r;const t=(e??[]).map((n,s)=>({c:n,key:typeof n.index=="number"?n.index:s})).sort((n,s)=>n.key-s.key);return(r=t[t.length-1])==null?void 0:r.c}function F0(e){var t;return((t=Op(e))==null?void 0:t.code)||void 0}function Np(e){return e.flatMap(t=>[t,...Np(t.children??[])])}function M0(e){var t;return Np(((t=Op(e))==null?void 0:t.terms)??[])}function B0(e){const t=new Set(e.map(s=>s.code).filter(s=>!!s)),r=new Set(e.map(s=>{var o,a;return s.parentCode??((a=(o=s.parents)==null?void 0:o.find(i=>i.code))==null?void 0:a.code)}).filter(s=>!!s&&t.has(s))),n=e.filter(s=>{var o;return s.code&&!((o=s.children)!=null&&o.length)&&!r.has(s.code)}).map(s=>s.code);return[...new Set(n)].sort()}function q0(e){const t=M0(e),r=new Map;return t.forEach(n=>{n.code&&n.name&&!r.has(n.code)&&r.set(n.code,n.name)}),B0(t).map(n=>({code:n,name:r.get(n)??n})).sort((n,s)=>n.name.localeCompare(s.name))}const $0=[],U0=[],V0=[],H0=[],fc=600*1e3;function z0(e){const t=q0(e==null?void 0:e.categories);return{skills:t,skillField:F0(e==null?void 0:e.categories),terms:t.map(r=>({identifier:r.code,code:r.code,name:r.name}))}}function Rp(e,t=!0){const r=zr({queryKey:["competency-frameworks",e??""],queryFn:()=>N0(e),enabled:t,staleTime:fc});return{frameworks:r.data??$0,isLoaded:r.isSuccess}}function hc(e){var n,s,o;const t=zr({queryKey:["competency-framework",e],queryFn:()=>R0(e),enabled:!!e,staleTime:fc,select:z0}),r=((n=t.data)==null?void 0:n.skills)??U0;return{skills:r,skillField:(s=t.data)==null?void 0:s.skillField,terms:((o=t.data)==null?void 0:o.terms)??H0,isLoaded:t.isSuccess,usableFrameworkId:e&&t.isSuccess&&r.length>0?e:void 0}}function Pp(e){return{roles:zr({queryKey:["competency-roles",e],queryFn:()=>P0(e),enabled:!!e,staleTime:fc}).data??V0}}const Q0=[],W0=[];function Kr(){const e=Z(d=>d.editorProfile.key==="learningPath"),t=ae(d=>d.treeData[0]),r=ae(d=>d.treeCache),n=e?Za(t,r):void 0,s=e?b0(t,r):void 0,{usableFrameworkId:o,skillField:a,terms:i}=hc(n),{roles:c}=Pp(o),u=s?c.find(d=>d.id===s):void 0;return{frameworkId:o,terms:o?i:W0,skillField:o?a:void 0,roleSkills:(u==null?void 0:u.skills)??Q0}}const Hu=[];function pc(e){if(!(e!=null&&e.length))return null;const t=e.find(n=>n.code==="skill");if(t)return{code:t.code,terms:t.terms??Hu};const r=e.reduce((n,s)=>(s.index??-1/0)>(n.index??-1/0)?s:n);return{code:r.code,terms:r.terms??Hu}}function G0(e){var n,s,o,a;const t=(n=e==null?void 0:e.children)==null?void 0:n[0];if(!ot(t))return;const r=(a=(o=(s=t==null?void 0:t.children)==null?void 0:s[0])==null?void 0:o.metadata)==null?void 0:a.framework;return Array.isArray(r)?r[0]:r}function K0(e){const{competency:t,storedFramework:r,channelFrameworks:n,curriculum:s}=e;return t||(r&&(!n||n.includes(r))?null:s)}function kr(){var b,p;const e=Z(v=>v.editorConfig),t=Z(v=>v.contentFramework),r=ae(v=>v.treeData),n=G0(r[0])??t??((b=e==null?void 0:e.context)==null?void 0:b.framework),{organisationFramework:s}=Xa(n),o=Kr(),a=Z(v=>v.editorProfile.key==="learningPath"),i=ae(v=>v.treeCache),c=a?Za(r[0],i):void 0,u=(p=e==null?void 0:e.context)==null?void 0:p.channel,{frameworks:d,isLoaded:f}=Rp(u,!!c),m=pc(s==null?void 0:s.categories),h=g.useMemo(()=>f?d.map(v=>v.identifier):void 0,[f,d]);return g.useMemo(()=>K0({competency:o.frameworkId?{code:o.skillField??gp,terms:o.terms}:null,storedFramework:c,channelFrameworks:h,curriculum:m}),[o.frameworkId,o.skillField,o.terms,c,h,m==null?void 0:m.code,m==null?void 0:m.terms])}function Y0(e,t,r,n=[]){var c,u;if(n.length)return{scope:[...n],source:"role"};const s={scope:((t==null?void 0:t.terms)??[]).map(d=>d.code),source:"manual"};if(!t)return s;const o=Sp(e);if(!o)return s;const i=((c=r[o.id])==null?void 0:c[t.code])??((u=o.metadata)==null?void 0:u[t.code]);return{scope:Sn(i,t.terms),source:"prior"}}function Is(){const e=kr(),t=ae(s=>s.treeData),r=ae(s=>s.treeCache),{roleSkills:n}=Kr();return g.useMemo(()=>Y0(t[0],e,r,n),[t,e,r,n])}const Z0="_overlay_12iiv_1",X0="_modal_12iiv_15",J0="_modalHeader_12iiv_27",e1="_modalHeaderClose_12iiv_37",t1="_modalBody_12iiv_55",r1="_modalFooter_12iiv_62",n1="_checkRow_12iiv_69",s1="_formGroup_12iiv_112",o1="_textarea_12iiv_123",a1="_sliderGroup_12iiv_144",i1="_sliderValue_12iiv_156",l1="_sliderLabels_12iiv_164",c1="_sectionTitle_12iiv_172",Oe={overlay:Z0,modal:X0,modalHeader:J0,modalHeaderClose:e1,modalBody:t1,modalFooter:r1,checkRow:n1,formGroup:s1,textarea:o1,sliderGroup:a1,sliderValue:i1,sliderLabels:l1,sectionTitle:c1},u1=({objectType:e,onConfirm:t,onCancel:r})=>{const n=fe(),s=ae(p=>p.treeData[0]),o=ae(p=>p.treeCache),a=kr(),{scope:i}=Is(),{roleSkills:c}=Kr(),[u,d]=g.useState(null),f=dc(s,a==null?void 0:a.code,i,o,a==null?void 0:a.terms,c);g.useEffect(()=>{let p=!1;return d(null),k0(s).then(v=>{p||d(v)}).catch(v=>{console.error("[PublishChecklist] assessment-course re-check failed:",v),p||d([{code:"slotCourseCheckFailed",message:n.learningPath.assessmentCheckFailedToast}])}),()=>{p=!0}},[s]);const m=u===null,h=[...f,...u??[]],b=!m&&h.length===0;return l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",e]}),l.jsx("button",{className:Oe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Oe.modalBody,children:h.length===0?l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:m?n.learningPath.verifyingAssessmentCourses:`${n.publishChecklist.confirmPublishPrefix} ${e}?`}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Oe.sectionTitle,children:n.learningPath.resolveBeforePublishing}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:h.map((p,v)=>l.jsx("li",{children:p.message},`${p.code}-${p.nodeId??v}`))})]})}),l.jsxs("div",{className:Oe.modalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(ze,{variant:"primary",onClick:t,disabled:!b,children:n.publishChecklist.yesButton})]})]})})},d1=({contentId:e,onConfirm:t,onCancel:r})=>{const n=fe(),s=Z(m=>{var h,b;return(b=(h=m.editorConfig)==null?void 0:h.config)==null?void 0:b.objectType})||"Content",o=Z(m=>m.editorProfile.key==="learningPath"),a=Z(m=>m.publishChecklist)??[],[i,c]=g.useState({}),u=a.every(m=>i[m.code]),d=a.length===0||u,f=()=>{t()};return o?l.jsx(u1,{objectType:s,onConfirm:t,onCancel:r}):l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"publish-modal-title",children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.modalHeader,children:[l.jsxs("span",{id:"publish-modal-title",children:[n.publishChecklist.publishTitlePrefix," ",s]}),l.jsx("button",{className:Oe.modalHeaderClose,onClick:r,"aria-label":n.publishChecklist.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Oe.modalBody,children:a.length===0?l.jsxs("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:[n.publishChecklist.confirmPublishPrefix," ",s,"?"]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{className:Oe.sectionTitle,children:n.publishChecklist.checklistInstructions}),l.jsxs("label",{className:Oe.checkRow,children:[l.jsx("input",{type:"checkbox",checked:u,onChange:m=>c(Object.fromEntries(a.map(h=>[h.code,m.target.checked])))}),l.jsx("span",{children:l.jsx("strong",{children:n.publishChecklist.selectAllLabel})})]}),a.map(m=>l.jsxs("label",{className:Oe.checkRow,children:[l.jsx("input",{type:"checkbox",checked:!!i[m.code],onChange:h=>c(b=>({...b,[m.code]:h.target.checked}))}),l.jsx("span",{children:m.label})]},m.code))]})}),l.jsxs("div",{className:Oe.modalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:r,children:n.publishChecklist.noButton}),l.jsx(ze,{variant:"primary",onClick:f,disabled:!d,children:n.publishChecklist.yesButton})]})]})})},f1=({contentId:e,action:t,onConfirm:r,onCancel:n})=>{const s=fe(),[o,a]=g.useState(""),[i,c]=g.useState(7),u=t==="approve",d=u?s.qualityParamsModal.reviewQualityTitle:s.qualityParamsModal.rejectContentTitle,f=!u&&o.trim().length===0,m=()=>{u?r(o.trim(),i):r(o.trim())};return l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"quality-modal-title",children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.modalHeader,children:[l.jsx("span",{id:"quality-modal-title",children:d}),l.jsx("button",{className:Oe.modalHeaderClose,onClick:n,"aria-label":s.qualityParamsModal.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Oe.modalBody,children:u?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Oe.formGroup,children:[l.jsx("label",{htmlFor:"quality-score",children:s.qualityParamsModal.qualityScoreLabel}),l.jsxs("div",{className:Oe.sliderGroup,children:[l.jsx("input",{id:"quality-score",type:"range",min:0,max:10,step:1,value:i,onChange:h=>c(Number(h.target.value)),"aria-valuemin":0,"aria-valuemax":10,"aria-valuenow":i}),l.jsx("span",{className:Oe.sliderValue,children:i})]}),l.jsxs("div",{className:Oe.sliderLabels,children:[l.jsx("span",{children:s.qualityParamsModal.scorePoorLabel}),l.jsx("span",{children:s.qualityParamsModal.scoreExcellentLabel})]})]}),l.jsxs("div",{className:Oe.formGroup,children:[l.jsxs("label",{htmlFor:"quality-comment",children:[s.qualityParamsModal.commentLabel," ",l.jsx("span",{style:{fontWeight:400,color:"var(--sbx-gray-400, #9CA3AF)"},children:s.qualityParamsModal.optionalLabel})]}),l.jsx("textarea",{id:"quality-comment",className:Oe.textarea,placeholder:s.qualityParamsModal.commentPlaceholder,value:o,onChange:h=>a(h.target.value),rows:4})]})]}):l.jsxs("div",{className:Oe.formGroup,children:[l.jsxs("label",{htmlFor:"reject-reason",children:[s.qualityParamsModal.rejectionReasonLabel," ",l.jsx("span",{style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:"reject-reason",className:Oe.textarea,placeholder:s.qualityParamsModal.rejectReasonPlaceholder,value:o,onChange:h=>a(h.target.value),rows:5,required:!0,"aria-required":"true"}),o.trim().length===0&&l.jsx("p",{style:{fontSize:12,color:"var(--sbx-error, #DC2626)",marginTop:4},children:s.qualityParamsModal.rejectionRequiredMessage})]})}),l.jsxs("div",{className:Oe.modalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:n,children:s.qualityParamsModal.cancelButton}),l.jsx(ze,{variant:u?"primary":"danger",onClick:m,disabled:f,children:u?s.qualityParamsModal.approveButton:s.qualityParamsModal.rejectButton})]})]})})},h1=({message:e,onConfirm:t,onCancel:r})=>{const n=fe();return Hr.createPortal(l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.modalHeader,children:[l.jsx("span",{id:"confirm-dialog-title",children:n.confirmDialog.title}),l.jsx("button",{className:Oe.modalHeaderClose,onClick:r,"aria-label":n.confirmDialog.closeAriaLabel,children:"×"})]}),l.jsx("div",{className:Oe.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:e})}),l.jsxs("div",{className:Oe.modalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:r,children:n.confirmDialog.cancelButton}),l.jsx(ze,{variant:"danger",onClick:t,children:n.confirmDialog.confirmButton})]})]})}),document.body)},Fp=["email","firstName","lastName","identifier","organisations","rootOrgName","phone"];async function p1(e,t={}){var c,u,d,f;const n={"organisations.roles":[((c=t.objectType)==null?void 0:c.toLowerCase())==="textbook"?"BOOK_CREATOR":"CONTENT_CREATOR"]};t.rootOrgId&&(n.rootOrgId=[t.rootOrgId]);const s=e.includes("@"),o=/^\d{10,}$/.test(e.trim()),a={filters:n,fields:Fp,offset:0,limit:t.limit??200};return s?n.email=e.trim():o?n.phone=e.trim():a.query=e,((f=(d=(u=(await Ue.post("/action/user/v1/search",{request:a},{params:{fields:"orgName"},headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:u.result)==null?void 0:d.response)==null?void 0:f.content)??[]}async function m1(e){var r,n,s;return e.length?((s=(n=(r=(await Ue.post("/action/user/v1/search",{request:{filters:{userId:e},fields:Fp,limit:e.length}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:r.result)==null?void 0:n.response)==null?void 0:s.content)??[]:[]}async function g1(e){var r,n;return((n=(r=(await Ue.get(`/portal/user/v5/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.response)??{}}const v1="_container_r27rp_1",y1="_header_r27rp_13",b1="_title_r27rp_22",C1="_closeBtn_r27rp_29",S1="_body_r27rp_45",x1="_label_r27rp_54",_1="_searchSection_r27rp_62",w1="_searchRow_r27rp_68",T1="_searchInput_r27rp_74",E1="_searchSpinner_r27rp_89",k1="_resultsList_r27rp_105",A1="_resultItem_r27rp_118",L1="_userInfo_r27rp_133",I1="_userName_r27rp_141",D1="_userEmail_r27rp_150",j1="_userOrg_r27rp_158",O1="_noResults_r27rp_167",N1="_collabSection_r27rp_174",R1="_sectionTitle_r27rp_179",P1="_badge_r27rp_189",F1="_emptyCollab_r27rp_203",M1="_collabList_r27rp_214",B1="_collabItem_r27rp_223",q1="_userAvatar_r27rp_237",$1="_error_r27rp_251",U1="_success_r27rp_257",V1="_footer_r27rp_263",He={container:v1,header:y1,title:b1,closeBtn:C1,body:S1,label:x1,searchSection:_1,searchRow:w1,searchInput:T1,searchSpinner:E1,resultsList:k1,resultItem:A1,userInfo:L1,userName:I1,userEmail:D1,userOrg:j1,noResults:O1,collabSection:N1,sectionTitle:R1,badge:P1,emptyCollab:F1,collabList:M1,collabItem:B1,userAvatar:q1,error:$1,success:U1,footer:V1},H1=({contentId:e,onClose:t})=>{var N,F;const r=fe(),n=Z(I=>I.editorConfig),s=(N=n==null?void 0:n.context)==null?void 0:N.channel,o=(F=n==null?void 0:n.config)==null?void 0:F.objectType,[a,i]=g.useState(""),[c,u]=g.useState([]),[d,f]=g.useState(!1),[m,h]=g.useState([]),[b,p]=g.useState(!1),[v,y]=g.useState(""),[C,S]=g.useState(!1),x=g.useRef(null);g.useEffect(()=>{let I=!1;return(async()=>{try{const R=await mp(e),P=(R==null?void 0:R.collaborators)??[];if(!P.length)return;const O=await m1(P);if(I)return;const V=P.map(ne=>O.find(W=>W.identifier===ne)??{identifier:ne,firstName:ne});h(V)}catch{}})(),()=>{I=!0}},[e]),g.useEffect(()=>{x.current&&clearTimeout(x.current);const I=a.trim();if(I.length<2){u([]);return}return x.current=setTimeout(async()=>{f(!0);try{const R=await p1(I,{rootOrgId:s,objectType:o}),P=new Set(m.map(O=>O.identifier));u(R.filter(O=>!P.has(O.identifier)))}catch{u([])}finally{f(!1)}},300),()=>{x.current&&clearTimeout(x.current)}},[a,m,s,o]);const _=g.useCallback(I=>{h(R=>R.find(P=>P.identifier===I.identifier)?R:[...R,I]),u(R=>R.filter(P=>P.identifier!==I.identifier)),S(!1)},[]),w=g.useCallback(I=>{h(R=>R.filter(P=>P.identifier!==I)),S(!1)},[]),E=g.useCallback(async()=>{p(!0),y(""),S(!1);try{await v0(e,m.map(I=>I.identifier)),S(!0)}catch{y(r.manageCollaborators.saveFailed)}finally{p(!1)}},[e,m,r.manageCollaborators.saveFailed]),k=I=>`${I.firstName}${I.lastName?` ${I.lastName}`:""}`;return l.jsxs("div",{className:He.container,children:[l.jsxs("div",{className:He.header,children:[l.jsx("h2",{className:He.title,children:r.manageCollaborators.title}),l.jsx("button",{className:He.closeBtn,onClick:t,"aria-label":r.manageCollaborators.closeAriaLabel,children:l.jsx(Mr,{size:18})})]}),l.jsxs("div",{className:He.body,children:[l.jsxs("div",{className:He.searchSection,children:[l.jsx("label",{className:He.label,htmlFor:"collab-search",children:r.manageCollaborators.searchUsersLabel}),l.jsxs("div",{className:He.searchRow,children:[l.jsx("input",{id:"collab-search",type:"text",className:He.searchInput,placeholder:r.manageCollaborators.searchPlaceholder,value:a,onChange:I=>i(I.target.value)}),d&&l.jsx("span",{className:He.searchSpinner,"aria-label":r.manageCollaborators.searchingAriaLabel})]}),c.length>0&&l.jsx("ul",{className:He.resultsList,role:"listbox","aria-label":r.manageCollaborators.searchResultsAriaLabel,children:c.map(I=>{var R,P,O,V;return l.jsxs("li",{className:He.resultItem,role:"option","aria-selected":"false",children:[l.jsxs("div",{className:He.userInfo,children:[l.jsx("span",{className:He.userName,children:k(I)}),I.email&&l.jsx("span",{className:He.userEmail,children:I.email}),(((P=(R=I.organisations)==null?void 0:R[0])==null?void 0:P.orgName)??I.rootOrgName)&&l.jsx("span",{className:He.userOrg,children:((V=(O=I.organisations)==null?void 0:O[0])==null?void 0:V.orgName)??I.rootOrgName})]}),l.jsx(ze,{variant:"primary",size:"sm",onClick:()=>_(I),children:r.manageCollaborators.add})]},I.identifier)})}),a.trim().length>=2&&!d&&c.length===0&&l.jsx("p",{className:He.noResults,children:r.manageCollaborators.noUsersFound})]}),l.jsxs("div",{className:He.collabSection,children:[l.jsxs("h3",{className:He.sectionTitle,children:[r.manageCollaborators.currentCollaborators,m.length>0&&l.jsx("span",{className:He.badge,children:m.length})]}),m.length===0?l.jsx("p",{className:He.emptyCollab,children:r.manageCollaborators.noCollaboratorsYet}):l.jsx("ul",{className:He.collabList,children:m.map(I=>{var R,P,O,V;return l.jsxs("li",{className:He.collabItem,children:[l.jsx("div",{className:He.userAvatar,"aria-hidden":"true",children:k(I).charAt(0).toUpperCase()}),l.jsxs("div",{className:He.userInfo,children:[l.jsx("span",{className:He.userName,children:k(I)}),I.email&&l.jsx("span",{className:He.userEmail,children:I.email}),(((P=(R=I.organisations)==null?void 0:R[0])==null?void 0:P.orgName)??I.rootOrgName)&&l.jsx("span",{className:He.userOrg,children:((V=(O=I.organisations)==null?void 0:O[0])==null?void 0:V.orgName)??I.rootOrgName})]}),l.jsx(ze,{variant:"danger",size:"sm",onClick:()=>w(I.identifier),children:r.manageCollaborators.remove})]},I.identifier)})})]}),v&&l.jsx("p",{className:He.error,role:"alert",children:v}),C&&l.jsx("p",{className:He.success,role:"status",children:r.manageCollaborators.saveSuccess})]}),l.jsxs("div",{className:He.footer,children:[l.jsx(ze,{variant:"ghost",onClick:t,disabled:b,children:r.manageCollaborators.cancel}),l.jsx(ze,{variant:"primary",isLoading:b,onClick:E,children:r.manageCollaborators.save})]})]})};async function z1(e){return(await Ue.post("/api/dialcode/v1/read",{request:{dialcodes:[e]}})).data}async function Q1(e,t){var s;const n=((s=(await Ue.post(`/action/dialcode/v1/reserve/${e}`,{request:{dialcodes:{count:t,qrCodeSpec:{errorCorrectionLevel:"H"}}}})).data)==null?void 0:s.result)??{};return{processId:n.processId??"",reservedDialcodes:n.reservedDialcodes??{}}}async function W1(e){var n;const r=((n=(await Ue.get(`/action/dialcode/v1/process/status/${e}`)).data)==null?void 0:n.result)??{status:"PENDING"};return{...r,status:r.status==="PENDING"?"in-process":r.status}}const G1="_topbar_lk8lp_1",K1="_left_lk8lp_15",Y1="_right_lk8lp_23",Z1="_backBtn_lk8lp_30",X1="_title_lk8lp_49",J1="_profileBadge_lk8lp_61",eE="_statusChip_lk8lp_76",tE="_savedIndicator_lk8lp_88",rE="_unsaved_lk8lp_98",nE="_iconBtn_lk8lp_103",sE="_iconBtnLabel_lk8lp_130",oE="_qrDropdown_lk8lp_134",aE="_qrMenu_lk8lp_138",iE="_reviewBtns_lk8lp_173",lE="_sourcingBtns_lk8lp_182",cE="_modalOverlay_lk8lp_191",uE="_sbOverlay_lk8lp_201",dE="_sbModal_lk8lp_211",fE="_sbModalHeader_lk8lp_222",hE="_sbModalTitle_lk8lp_230",pE="_sbModalClose_lk8lp_237",mE="_sbModalBody_lk8lp_250",gE="_sbLabel_lk8lp_257",vE="_sbTextarea_lk8lp_264",yE="_sbError_lk8lp_281",bE="_sbModalFooter_lk8lp_288",Le={topbar:G1,left:K1,right:Y1,backBtn:Z1,title:X1,profileBadge:J1,statusChip:eE,savedIndicator:tE,unsaved:rE,iconBtn:nE,iconBtnLabel:sE,qrDropdown:oE,qrMenu:aE,reviewBtns:iE,sourcingBtns:lE,modalOverlay:cE,sbOverlay:uE,sbModal:dE,sbModalHeader:fE,sbModalTitle:hE,sbModalClose:pE,sbModalBody:mE,sbLabel:gE,sbTextarea:vE,sbError:yE,sbModalFooter:bE};function CE(e){return e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):""}function SE(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():t}const xE=({titleText:e,labelText:t,placeholderText:r,submitLabel:n,submitVariant:s="primary",onConfirm:o,onCancel:a})=>{const i=fe(),[c,u]=g.useState(""),d=e.toLowerCase().replace(/\s+/g,"-");return l.jsx("div",{className:Le.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":`${d}-title`,children:l.jsxs("div",{className:Le.sbModal,children:[l.jsxs("div",{className:Le.sbModalHeader,children:[l.jsx("span",{id:`${d}-title`,className:Le.sbModalTitle,children:e}),l.jsx("button",{className:Le.sbModalClose,onClick:a,"aria-label":i.reviewCommentModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Le.sbModalBody,children:[l.jsxs("label",{className:Le.sbLabel,htmlFor:`${d}-comment`,children:[t," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("textarea",{id:`${d}-comment`,className:Le.sbTextarea,placeholder:r,value:c,onChange:f=>u(f.target.value),rows:4,required:!0,"aria-required":"true"}),c.trim().length===0&&l.jsx("p",{className:Le.sbError,children:i.reviewCommentModal.fillCommentsError})]}),l.jsxs("div",{className:Le.sbModalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:a,children:i.reviewCommentModal.cancelButton}),l.jsx(ze,{variant:s,onClick:()=>o(c.trim()),disabled:c.trim().length===0,children:n})]})]})})},_E=({onConfirm:e,onCancel:t})=>{const r=fe(),[n,s]=g.useState(!1),o=Z(h=>h.editorProfile.key==="learningPath"),a=ae(h=>h.treeData[0]),i=ae(h=>h.treeCache),c=kr(),{scope:u}=Is(),{roleSkills:d}=Kr(),f=o?dc(a,c==null?void 0:c.code,u,i,c==null?void 0:c.terms,d):[],m=f.length>0;return l.jsx("div",{className:Le.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"review-confirm-title",children:l.jsxs("div",{className:Le.sbModal,children:[l.jsxs("div",{className:Le.sbModalHeader,children:[l.jsx("span",{id:"review-confirm-title",className:Le.sbModalTitle,children:r.confirmReviewModal.title}),l.jsx("button",{className:Le.sbModalClose,onClick:t,"aria-label":r.confirmReviewModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsx("div",{className:Le.sbModalBody,children:m?l.jsxs(l.Fragment,{children:[l.jsx("p",{style:{margin:"0 0 8px",fontSize:13,fontWeight:600},children:r.learningPath.resolveBeforeSendingForReview}),l.jsx("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:f.map((h,b)=>l.jsx("li",{children:h.message},`${h.code}-${h.nodeId??b}`))})]}):l.jsxs("label",{style:{display:"flex",gap:8,alignItems:"flex-start",fontSize:13,lineHeight:1.55},children:[l.jsx("input",{type:"checkbox",checked:n,onChange:h=>s(h.target.checked),style:{marginTop:2}}),l.jsxs("span",{children:[r.confirmReviewModal.agreementTextPart1," ",l.jsx("a",{className:"sb-color-primary",style:{fontWeight:600},href:"https://creativecommons.org/licenses",target:"_blank",rel:"noreferrer",children:r.confirmReviewModal.creativeCommonsLinkText})," ",r.confirmReviewModal.agreementTextPart2," ",l.jsx("strong",{children:r.confirmReviewModal.contentPolicyText}),r.confirmReviewModal.agreementTextPart3]})]})}),l.jsxs("div",{className:Le.sbModalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:t,children:r.confirmReviewModal.cancelButton}),!m&&l.jsx(ze,{variant:"primary",onClick:e,disabled:!n,children:r.confirmReviewModal.submitButton})]})]})})},wE=({onConfirm:e,onCancel:t})=>{const r=fe(),[n,s]=g.useState(""),o=parseInt(n,10),a=!isNaN(o)&&o>=2&&o<=250;return l.jsx("div",{className:Le.sbOverlay,role:"dialog","aria-modal":"true","aria-labelledby":"genqr-title",children:l.jsxs("div",{className:Le.sbModal,children:[l.jsxs("div",{className:Le.sbModalHeader,children:[l.jsx("span",{id:"genqr-title",className:Le.sbModalTitle,children:r.generateQRModal.title}),l.jsx("button",{className:Le.sbModalClose,onClick:t,"aria-label":r.generateQRModal.closeAriaLabel,type:"button",children:"×"})]}),l.jsxs("div",{className:Le.sbModalBody,children:[l.jsxs("label",{className:Le.sbLabel,htmlFor:"qr-count",children:[r.generateQRModal.numberOfCodesLabel," ",l.jsx("span",{"aria-hidden":"true",style:{color:"var(--sbx-error, #DC2626)"},children:"*"})]}),l.jsx("input",{id:"qr-count",type:"number",min:2,max:250,className:Le.sbTextarea,style:{resize:"none",height:"40px"},placeholder:r.generateQRModal.countPlaceholder,value:n,onChange:i=>s(i.target.value)}),n&&!a&&l.jsx("p",{className:Le.sbError,children:r.generateQRModal.countRangeError})]}),l.jsxs("div",{className:Le.sbModalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:t,children:r.generateQRModal.cancelButton}),l.jsx(ze,{variant:"primary",onClick:()=>e(o),disabled:!a,children:r.generateQRModal.generateButton})]})]})})},TE=({editorMode:e,isSaving:t,isDirty:r,lastSaved:n,isFormValid:s=!0,onToolbarEvent:o})=>{var J,de;const a=fe(),c=ae(X=>X.treeData)[0],u=(c==null?void 0:c.name)??a.contextualEditor.untitledPlaceholder,d=SE(((J=c==null?void 0:c.metadata)==null?void 0:J.status)??(c==null?void 0:c.status),a.topbar.draftStatusFallback),f=Z(X=>{var Ce,Ne,re,ce;return((Ne=(Ce=X.editorConfig)==null?void 0:Ce.context)==null?void 0:Ne.contentId)??((ce=(re=X.editorConfig)==null?void 0:re.context)==null?void 0:ce.identifier)??""}),{activeModal:m,modalData:h,closeModal:b,openModal:p}=at(),v=Z(X=>X.buttonLoaders),y=Z(X=>X.categoryMeta),C=Z(X=>X.editorProfile),S=C.key==="learningPath",x=C.features.dialcodes&&(!y||y.schemaDefaults.generateDIALCodes!=="No"),[_,w]=g.useState(!1),[E,k]=g.useState(!1),[N,F]=g.useState(!1),I=g.useRef(null),[R,P]=g.useState(!1);g.useEffect(()=>{if(!N)return;const X=Ce=>{var Ne;(Ne=I.current)!=null&&Ne.contains(Ce.target)||F(!1)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[N]);const[O,V]=g.useState(!1),[ne,W]=g.useState(!1),{updateNode:ue}=ae(),ie=(de=c==null?void 0:c.metadata)==null?void 0:de.qrCodeProcessId,ve=g.useCallback(async X=>{if(f){P(!1),V(!0);try{const{processId:Ce,reservedDialcodes:Ne}=await Q1(f,X);Ce&&c&&ue(c.id,{qrCodeProcessId:Ce,reservedDialcodes:Ne}),Se.success(a.topbar.qrGenerationStartedToast)}catch{Se.error(a.topbar.qrGenerationFailedToast)}finally{V(!1)}}},[f,c,ue,a]),me=g.useCallback(async()=>{if(!ie){Se.error(a.topbar.qrCodesNotGeneratedToast);return}W(!0);try{const X=await W1(ie);if(X.status==="in-process"){Se(a.topbar.qrGenerationInProgressToast,{icon:l.jsx(Vr,{size:16})});return}const Ce=X.url;if(!Ce){Se.error(a.topbar.qrCodesNotReadyToast);return}const Ne=await fetch(Ce).then(xe=>xe.blob()),re=await new Promise(xe=>{const Pe=new FileReader;Pe.onloadend=()=>xe(Pe.result),Pe.readAsDataURL(Ne)}),ce=(c==null?void 0:c.metadata)??{},G=xe=>Array.isArray(xe)?xe.join("_"):typeof xe=="string"?xe:"",U=[f,G(ce.medium),G(ce.gradeLevel),G(ce.subject)].filter(Boolean),Ee=new Date().toISOString().replace(/[:.]/g,"-"),we=`${U.join("_")}_${Ee}.zip`,ke=document.createElement("a");ke.href=re,ke.download=we,ke.style.display="none",document.body.appendChild(ke),ke.click(),document.body.removeChild(ke),Se.success(a.topbar.qrCodesDownloadedToast)}catch{Se.error(a.topbar.qrCodesDownloadFailedToast)}finally{W(!1)}},[ie,c,f,a]),H=e==="edit",be=e==="review",Te=e==="sourcingreview",$=e==="read",B=g.useCallback((X,Ce)=>{o({action:X,data:Ce})},[o]),le=g.useCallback(()=>{b(),B("publish")},[b,B]),ge=g.useCallback((X,Ce)=>{const Ne=h==null?void 0:h.action;b(),Ne==="approve"?B("sourcingApprove",{comment:X,score:Ce}):B("reject",{comment:X})},[b,B,h]);return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:Le.topbar,role:"banner",children:[l.jsxs("div",{className:Le.left,children:[l.jsx("button",{className:Le.backBtn,onClick:()=>B("back"),"aria-label":a.topbar.backAriaLabel,type:"button",children:l.jsx(Zl,{size:18})}),l.jsx("h1",{className:Le.title,title:u,children:u}),S&&l.jsxs("span",{className:Le.profileBadge,children:[l.jsx(jp,{size:13,"aria-hidden":"true"}),a.learningPath.profileBadgeLabel]}),l.jsx("span",{className:`sbx-chip ${Le.statusChip}`,"aria-label":`${a.topbar.statusAriaLabelPrefix} ${d}`,children:d})]}),l.jsxs("div",{className:Le.right,children:[t?l.jsx("span",{className:Le.savedIndicator,"aria-live":"polite",children:a.topbar.savingIndicator}):r&&H?l.jsx("span",{className:`${Le.savedIndicator} ${Le.unsaved}`,"aria-live":"polite",children:a.topbar.unsavedIndicator}):n?l.jsxs("span",{className:Le.savedIndicator,"aria-live":"polite",children:[l.jsx(Es,{size:14,"aria-hidden":"true"}),a.topbar.savedIndicatorPrefix," ",CE(n)]}):null,!$&&!be&&!Te&&d!=="Review"&&l.jsx("span",{title:s?void 0:a.topbar.fillRequiredFieldsTooltip,children:l.jsx(ze,{variant:"ghost",size:"sm",onClick:()=>B("saveCollection"),disabled:!s,children:a.topbar.saveAsDraftButton})}),H&&l.jsxs(l.Fragment,{children:[l.jsxs(ze,{variant:"primary",size:"sm",onClick:()=>k(!0),disabled:v.saveCollection,isLoading:v.saveCollection,children:[l.jsx(Kb,{size:14,"aria-hidden":"true"})," ",a.topbar.sendForReviewButton]}),C.features.collaborators&&l.jsx("button",{className:Le.iconBtn,onClick:()=>p("manageCollaborators"),"aria-label":a.topbar.collaboratorsLabel,title:a.topbar.collaboratorsLabel,type:"button",children:l.jsx(rC,{size:16,"aria-hidden":"true"})}),x&&l.jsxs("div",{className:Le.qrDropdown,ref:I,children:[l.jsxs("button",{className:Le.iconBtn,onClick:()=>F(X=>!X),"aria-label":a.topbar.qrCodesLabel,title:a.topbar.qrCodesLabel,type:"button","aria-haspopup":"true","aria-expanded":N,children:[l.jsx(du,{size:16,"aria-hidden":"true"}),l.jsx("span",{className:Le.iconBtnLabel,children:a.topbar.qrCodesLabel}),l.jsx(bn,{size:14,style:{marginLeft:2},"aria-hidden":"true"})]}),N&&l.jsxs("div",{className:Le.qrMenu,role:"menu",children:[l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),P(!0)},disabled:O,children:[l.jsx(du,{size:14}),O?a.topbar.generatingEllipsis:a.topbar.generateQrCodesMenuItem]}),l.jsxs("button",{role:"menuitem",type:"button",onClick:()=>{F(!1),me()},disabled:ne||!ie,children:[l.jsx(Rb,{size:14}),ne?a.topbar.downloadingEllipsis:a.topbar.downloadQrCodesMenuItem]})]})]})]}),be&&l.jsxs("div",{className:Le.reviewBtns,children:[l.jsxs(ze,{variant:"primary",size:"sm",onClick:()=>p("publishChecklist"),disabled:v.publishCollection,isLoading:v.publishCollection,children:[l.jsx(jh,{size:14,"aria-hidden":"true"})," ",a.topbar.publishButton]}),l.jsxs(ze,{variant:"primary",size:"sm",onClick:()=>w(!0),disabled:v.rejectCollection,isLoading:v.rejectCollection,children:[l.jsx(fu,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]}),Te&&l.jsxs("div",{className:Le.sourcingBtns,children:[l.jsxs(ze,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"approve"}),children:[l.jsx(Zb,{size:14,"aria-hidden":"true"})," ",a.topbar.approveButton]}),l.jsxs(ze,{variant:"primary",size:"sm",onClick:()=>p("qualityParams",{action:"reject"}),children:[l.jsx(fu,{size:14,"aria-hidden":"true"})," ",a.topbar.requestForChangesButton]})]})]})]}),m==="publishChecklist"&&l.jsx(d1,{contentId:f,onConfirm:le,onCancel:b}),m==="qualityParams"&&l.jsx(f1,{contentId:f,action:(h==null?void 0:h.action)??"reject",onConfirm:ge,onCancel:b}),m==="manageCollaborators"&&l.jsx("div",{className:Le.modalOverlay,role:"dialog","aria-modal":"true",children:l.jsx(H1,{contentId:f,onClose:b})}),m==="confirmDelete"&&l.jsx(h1,{message:(h==null?void 0:h.message)??"",onConfirm:()=>{const X=h==null?void 0:h.onConfirm;b(),X==null||X()},onCancel:b}),E&&l.jsx(_E,{onConfirm:()=>{k(!1),B("sendForReview")},onCancel:()=>k(!1)}),_&&l.jsx(xE,{titleText:a.topbar.requestChangesTitle,labelText:a.topbar.changesRequestedLabel,placeholderText:a.topbar.describeChangesPlaceholder,submitLabel:a.topbar.requestForChangesButton,submitVariant:"primary",onConfirm:X=>{w(!1),B("reject",{comment:X})},onCancel:()=>w(!1)}),R&&l.jsx(wE,{onConfirm:ve,onCancel:()=>P(!1)})]})},EE=({onSave:e,onDiscard:t,onCancel:r,isSaving:n})=>{const s=fe();return Hr.createPortal(l.jsx("div",{className:Oe.overlay,role:"dialog","aria-modal":"true","aria-labelledby":"unsaved-title",children:l.jsxs("div",{className:Oe.modal,children:[l.jsxs("div",{className:Oe.modalHeader,children:[l.jsx("span",{id:"unsaved-title",children:s.unsavedChangesModal.title}),l.jsx("button",{className:Oe.modalHeaderClose,onClick:r,"aria-label":s.unsavedChangesModal.closeAriaLabel,disabled:n,children:"×"})]}),l.jsx("div",{className:Oe.modalBody,children:l.jsx("p",{style:{margin:0,fontSize:14,lineHeight:1.5},children:s.unsavedChangesModal.bodyMessage})}),l.jsxs("div",{className:Oe.modalFooter,children:[l.jsx(ze,{variant:"ghost",onClick:r,disabled:n,children:s.unsavedChangesModal.cancelButton}),l.jsx(ze,{variant:"danger",onClick:t,disabled:n,children:s.unsavedChangesModal.discardButton}),l.jsx(ze,{variant:"primary",onClick:e,isLoading:n,disabled:n,children:s.unsavedChangesModal.saveButton})]})]})}),document.body)};var kE=ec();const Mp=g.createContext(null);function Xt(){const e=g.useContext(Mp);if(e===null)throw new Error("No Tree Api Provided");return e}const Bp=g.createContext(null);function AE(){const e=g.useContext(Bp);if(e===null)throw new Error("Provide a NodesContext");return e}const qp=g.createContext(null);function LE(){const e=g.useContext(qp);if(e===null)throw new Error("Provide a DnDContext");return e}const $p=g.createContext(0);function Up(){g.useContext($p)}function ea(e,t,r){return Math.max(Math.min(e,r),t)}function Vp(e){return e&&e.isLeaf}function Hp(e){return e&&e.isInternal&&!e.isOpen}function zp(e){var t;return e&&e.isOpen&&!(!((t=e.children)===null||t===void 0)&&t.length)}const Qp=(e,t)=>{let r=e;for(;r;){if(r.id===t.id)return!0;r=r.parent}return!1},Wp=e=>{if(!e.parent)throw Error("Node does not have a parent");return e.parent.children.findIndex(t=>t.id===e.id)};function mc(e,t){if(!e)return null;if(e.id===t)return e;if(e.children)for(let r of e.children){const n=mc(r,t);if(n)return n}return null}function _a(e,t){if(t(e),e.children)for(let r of e.children)_a(r,t)}function Gp(e){const t=Yp(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=IE(t,n);break}r==null||r.focus()}function Kp(e){const t=Yp(e);let r;for(let n=0;n<t.length;++n)if(t[n]===e){r=DE(t,n);break}r==null||r.focus()}function IE(e,t){return t+1<e.length?e[t+1]:e[0]}function DE(e,t){return t-1>=0?e[t-1]:e[e.length-1]}function Yp(e){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(t=>t===e||!e.contains(t))}function Hs(e,t){return typeof t=="boolean"?t:typeof t=="string"?e[t]:t(e)}function ts(e){return typeof e=="string"?e:e.id}function jE(e,...t){if(e)return e(...t)}function Zp(e){return new Promise((t,r)=>{let n=0;function s(){n+=1,n===100&&r(),e()?t():setTimeout(s,10)}s()})}function Xp(e){var t,r;const n=e.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(t=e.root.children)===null||t===void 0?void 0:t.length)!==null&&r!==void 0?r:0}function Jp(e){const t=e.focusedNode;return t?t.isOpen?t.id:t.parent&&!t.parent.isRoot?t.parent.id:null:null}const OE=Object.freeze(Object.defineProperty({__proto__:null,access:Hs,bound:ea,dfs:mc,focusNextElement:Gp,focusPrevElement:Kp,getInsertIndex:Xp,getInsertParentId:Jp,identify:ts,indexOf:Wp,isClosed:Hp,isDescendant:Qp,isItem:Vp,isOpenWithEmptyChildren:zp,safeRun:jE,waitFor:Zp,walk:_a},Symbol.toStringTag,{value:"Module"})),NE={display:"flex",alignItems:"center",zIndex:1},RE={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},PE={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},FE=g.memo(function({top:t,left:r,indent:n}){const s={position:"absolute",pointerEvents:"none",top:t-2+"px",left:r+"px",right:n+"px"};return l.jsxs("div",{style:Object.assign(Object.assign({},NE),s),children:[l.jsx("div",{style:Object.assign({},PE)}),l.jsx("div",{style:Object.assign({},RE)})]})});function ME({node:e,attrs:t,innerRef:r,children:n}){return l.jsx("div",Object.assign({},t,{ref:r,onFocus:s=>s.stopPropagation(),onClick:e.handleClick,children:n}))}function BE(e){return l.jsxs("div",{ref:e.dragHandle,style:e.style,children:[l.jsx("span",{onClick:t=>{t.stopPropagation(),e.node.toggle()},children:e.node.isLeaf?"🌳":e.node.isOpen?"🗁":"🗀"})," ",e.node.isEditing?l.jsx($E,Object.assign({},e)):l.jsx(qE,Object.assign({},e))]})}function qE(e){return l.jsx(l.Fragment,{children:l.jsx("span",{children:e.node.data.name})})}function $E({node:e}){const t=g.useRef();return g.useEffect(()=>{var r,n;(r=t.current)===null||r===void 0||r.focus(),(n=t.current)===null||n===void 0||n.select()},[]),l.jsx("input",{ref:t,defaultValue:e.data.name,onBlur:()=>e.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&e.reset(),r.key==="Enter"&&e.submit(((n=t.current)===null||n===void 0?void 0:n.value)||"")}})}const io="__REACT_ARBORIST_INTERNAL_ROOT__";function zu(e){var t;function r(o,a,i){const c=e.accessId(o),u=new lo({tree:e,data:o,level:a,parent:i,id:c,children:null,isDraggable:e.isDraggable(o),rowIndex:null}),d=e.accessChildren(o);return d&&(u.children=d.map(f=>r(f,a+1,u))),u}const n=new lo({tree:e,id:io,data:{id:io},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),s=(t=e.props.data)!==null&&t!==void 0?t:[];return n.children=s.map(o=>r(o,0,n)),n}class lo{constructor(t){this.handleClick=r=>{(r.metaKey||r.ctrlKey)&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=t.tree,this.id=t.id,this.data=t.data,this.level=t.level,this.children=t.children,this.parent=t.parent,this.isDraggable=t.isDraggable,this.rowIndex=t.rowIndex}get isRoot(){return this.id===io}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isSelectable(){return this.tree.isSelectable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var t;return this.isSelected&&!(!((t=this.prev)===null||t===void 0)&&t.isSelected)}get isSelectedEnd(){var t;return this.isSelected&&!(!((t=this.next)===null||t===void 0)&&t.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(t=>t.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var t,r;const n=this.childIndex;return(r=(t=this.parent)===null||t===void 0?void 0:t.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(t){if(!t)return!1;let r=t;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(t){this.tree.submit(this,t)}reset(){this.tree.reset()}clone(){return new lo(Object.assign({},this))}edit(){return this.tree.edit(this)}}function Si(e){return{type:"EDIT",id:e}}function UE(e={id:null},t){return t.type==="EDIT"?Object.assign(Object.assign({},e),{id:t.id}):e}function zn(e){return{type:"FOCUS",id:e}}function VE(){return{type:"TREE_BLUR"}}function HE(e={id:null,treeFocused:!1},t){return t.type==="FOCUS"?Object.assign(Object.assign({},e),{id:t.id,treeFocused:!0}):t.type==="TREE_BLUR"?Object.assign(Object.assign({},e),{treeFocused:!1}):e}const _l={open(e,t){return{type:"VISIBILITY_OPEN",id:e,filtered:t}},close(e,t){return{type:"VISIBILITY_CLOSE",id:e,filtered:t}},toggle(e,t){return{type:"VISIBILITY_TOGGLE",id:e,filtered:t}},clear(e){return{type:"VISIBILITY_CLEAR",filtered:e}}};function Qu(e={},t){if(t.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},e),{[t.id]:!0});if(t.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},e),{[t.id]:!1});if(t.type==="VISIBILITY_TOGGLE"){const r=e[t.id];return Object.assign(Object.assign({},e),{[t.id]:!r})}else return t.type==="VISIBILITY_CLEAR"?{}:e}function zE(e={filtered:{},unfiltered:{}},t){return t.type.startsWith("VISIBILITY")?t.filtered?Object.assign(Object.assign({},e),{filtered:Qu(e.filtered,t)}):Object.assign(Object.assign({},e),{unfiltered:Qu(e.unfiltered,t)}):e}const Ss=e=>{var t;return{nodes:{open:{filtered:{},unfiltered:(t=e==null?void 0:e.initialOpenState)!==null&&t!==void 0?t:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},rn={clear:()=>({type:"SELECTION_CLEAR"}),only:e=>({type:"SELECTION_ONLY",id:ts(e)}),add:e=>({type:"SELECTION_ADD",ids:(Array.isArray(e)?e:[e]).map(ts)}),remove:e=>({type:"SELECTION_REMOVE",ids:(Array.isArray(e)?e:[e]).map(ts)}),set:e=>Object.assign({type:"SELECTION_SET"},e),mostRecent:e=>({type:"SELECTION_MOST_RECENT",id:e===null?null:ts(e)}),anchor:e=>({type:"SELECTION_ANCHOR",id:e===null?null:ts(e)})};function QE(e=Ss().nodes.selection,t){const r=e.ids;switch(t.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},e),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},e),{ids:new Set([t.id])});case"SELECTION_ADD":return t.ids.length===0?e:(t.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_REMOVE":return t.ids.length===0?e:(t.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},e),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},e),{ids:t.ids,mostRecent:t.mostRecent,anchor:t.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},e),{mostRecent:t.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},e),{anchor:t.id});default:return e}}const xs={cursor(e){return{type:"DND_CURSOR",cursor:e}},dragStart(e,t){return{type:"DND_DRAG_START",id:e,dragIds:t}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(e,t){return{type:"DND_HOVERING",parentId:e,index:t}}};function WE(e=Ss().dnd,t){switch(t.type){case"DND_CURSOR":return Object.assign(Object.assign({},e),{cursor:t.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},e),{dragId:t.id,dragIds:t.dragIds});case"DND_DRAG_END":return Ss().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},e),{parentId:t.parentId,index:t.index});default:return e}}const GE={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},KE=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t}px, ${r}px)`}},YE=e=>{if(!e)return{display:"none"};const{x:t,y:r}=e;return{transform:`translate(${t+10}px, ${r+10}px)`}};function em({offset:e,mouse:t,id:r,dragIds:n,isDragging:s}){return l.jsxs(ZE,{isDragging:s,children:[l.jsx(XE,{offset:e,children:l.jsx(ek,{id:r,dragIds:n})}),l.jsx(JE,{mouse:t,count:n.length})]})}const ZE=g.memo(function(t){return t.isDragging?l.jsx("div",{style:GE,children:t.children}):null});function XE(e){return l.jsx("div",{className:"row preview",style:KE(e.offset),children:e.children})}function JE(e){const{count:t,mouse:r}=e;return t>1?l.jsx("div",{className:"selected-count",style:YE(r),children:t}):null}const ek=g.memo(function(t){const r=Xt(),n=r.get(t.id);return n?l.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function wl(){return wl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wl.apply(null,arguments)}function Wu(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Tl(e,t){return Tl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Tl(e,t)}function tk(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Tl(e,t)}var Gu=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function rk(e,t){return!!(e===t||Gu(e)&&Gu(t))}function nk(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(!rk(e[r],t[r]))return!1;return!0}function xi(e,t){t===void 0&&(t=nk);var r,n=[],s,o=!1;function a(){for(var i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];return o&&r===this&&t(i,n)||(s=e.apply(this,i),o=!0,r=this,n=i),s}return a}var sk=typeof performance=="object"&&typeof performance.now=="function",Ku=sk?function(){return performance.now()}:function(){return Date.now()};function Yu(e){cancelAnimationFrame(e.id)}function ok(e,t){var r=Ku();function n(){Ku()-r>=t?e.call(null):s.id=requestAnimationFrame(n)}var s={id:requestAnimationFrame(n)};return s}var _i=-1;function Zu(e){if(e===void 0&&(e=!1),_i===-1||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(t),_i=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return _i}var Qn=null;function Xu(e){if(e===void 0&&(e=!1),Qn===null||e){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),s=n.style;return s.width="100px",s.height="100px",t.appendChild(n),document.body.appendChild(t),t.scrollLeft>0?Qn="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Qn="negative":Qn="positive-ascending"),document.body.removeChild(t),Qn}return Qn}process.env.NODE_ENV;var ak=150,ik=function(t,r){return t},ta=null,ra=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(ta=new WeakSet,ra=new WeakSet);function tm(e){var t,r=e.getItemOffset,n=e.getEstimatedTotalSize,s=e.getItemSize,o=e.getOffsetForIndexAndAlignment,a=e.getStartIndexForOffset,i=e.getStopIndexForStartIndex,c=e.initInstanceProps,u=e.shouldResetStyleCacheOnItemSizeChange,d=e.validateProps;return t=(function(f){tk(m,f);function m(b){var p;return p=f.call(this,b)||this,p._instanceProps=c(p.props,Wu(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:Wu(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=xi(function(v,y,C,S){return p.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:C,visibleStopIndex:S})}),p._callOnScroll=void 0,p._callOnScroll=xi(function(v,y,C){return p.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:C})}),p._getItemStyle=void 0,p._getItemStyle=function(v){var y=p.props,C=y.direction,S=y.itemSize,x=y.layout,_=p._getItemStyleCache(u&&S,u&&x,u&&C),w;if(_.hasOwnProperty(v))w=_[v];else{var E=r(p.props,v,p._instanceProps),k=s(p.props,v,p._instanceProps),N=C==="horizontal"||x==="horizontal",F=C==="rtl",I=N?E:0;_[v]=w={position:"absolute",left:F?void 0:I,right:F?I:void 0,top:N?0:E,height:N?"100%":k,width:N?k:"100%"}}return w},p._getItemStyleCache=void 0,p._getItemStyleCache=xi(function(v,y,C){return{}}),p._onScrollHorizontal=function(v){var y=v.currentTarget,C=y.clientWidth,S=y.scrollLeft,x=y.scrollWidth;p.setState(function(_){if(_.scrollOffset===S)return null;var w=p.props.direction,E=S;if(w==="rtl")switch(Xu()){case"negative":E=-S;break;case"positive-descending":E=x-C-S;break}return E=Math.max(0,Math.min(E,x-C)),{isScrolling:!0,scrollDirection:_.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(v){var y=v.currentTarget,C=y.clientHeight,S=y.scrollHeight,x=y.scrollTop;p.setState(function(_){if(_.scrollOffset===x)return null;var w=Math.max(0,Math.min(x,S-C));return{isScrolling:!0,scrollDirection:_.scrollOffset<w?"forward":"backward",scrollOffset:w,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(v){var y=p.props.outerRef;p._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&Yu(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=ok(p._resetIsScrolling,ak)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}m.getDerivedStateFromProps=function(p,v){return lk(p,v),d(p),null};var h=m.prototype;return h.scrollTo=function(p){p=Math.max(0,p),this.setState(function(v){return v.scrollOffset===p?null:{scrollDirection:v.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},h.scrollToItem=function(p,v){v===void 0&&(v="auto");var y=this.props,C=y.itemCount,S=y.layout,x=this.state.scrollOffset;p=Math.max(0,Math.min(p,C-1));var _=0;if(this._outerRef){var w=this._outerRef;S==="vertical"?_=w.scrollWidth>w.clientWidth?Zu():0:_=w.scrollHeight>w.clientHeight?Zu():0}this.scrollTo(o(this.props,p,v,x,this._instanceProps,_))},h.componentDidMount=function(){var p=this.props,v=p.direction,y=p.initialScrollOffset,C=p.layout;if(typeof y=="number"&&this._outerRef!=null){var S=this._outerRef;v==="horizontal"||C==="horizontal"?S.scrollLeft=y:S.scrollTop=y}this._callPropsCallbacks()},h.componentDidUpdate=function(){var p=this.props,v=p.direction,y=p.layout,C=this.state,S=C.scrollOffset,x=C.scrollUpdateWasRequested;if(x&&this._outerRef!=null){var _=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(Xu()){case"negative":_.scrollLeft=-S;break;case"positive-ascending":_.scrollLeft=S;break;default:var w=_.clientWidth,E=_.scrollWidth;_.scrollLeft=E-w-S;break}else _.scrollLeft=S;else _.scrollTop=S}this._callPropsCallbacks()},h.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Yu(this._resetIsScrollingTimeoutId)},h.render=function(){var p=this.props,v=p.children,y=p.className,C=p.direction,S=p.height,x=p.innerRef,_=p.innerElementType,w=p.innerTagName,E=p.itemCount,k=p.itemData,N=p.itemKey,F=N===void 0?ik:N,I=p.layout,R=p.outerElementType,P=p.outerTagName,O=p.style,V=p.useIsScrolling,ne=p.width,W=this.state.isScrolling,ue=C==="horizontal"||I==="horizontal",ie=ue?this._onScrollHorizontal:this._onScrollVertical,ve=this._getRangeToRender(),me=ve[0],H=ve[1],be=[];if(E>0)for(var Te=me;Te<=H;Te++)be.push(g.createElement(v,{data:k,key:F(Te,k),index:Te,isScrolling:V?W:void 0,style:this._getItemStyle(Te)}));var $=n(this.props,this._instanceProps);return g.createElement(R||P||"div",{className:y,onScroll:ie,ref:this._outerRefSetter,style:wl({position:"relative",height:S,width:ne,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:C},O)},g.createElement(_||w||"div",{children:be,ref:x,style:{height:ue?"100%":$,pointerEvents:W?"none":void 0,width:ue?$:"100%"}}))},h._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var v=this._getRangeToRender(),y=v[0],C=v[1],S=v[2],x=v[3];this._callOnItemsRendered(y,C,S,x)}}if(typeof this.props.onScroll=="function"){var _=this.state,w=_.scrollDirection,E=_.scrollOffset,k=_.scrollUpdateWasRequested;this._callOnScroll(w,E,k)}},h._getRangeToRender=function(){var p=this.props,v=p.itemCount,y=p.overscanCount,C=this.state,S=C.isScrolling,x=C.scrollDirection,_=C.scrollOffset;if(v===0)return[0,0,0,0];var w=a(this.props,_,this._instanceProps),E=i(this.props,w,_,this._instanceProps),k=!S||x==="backward"?Math.max(1,y):1,N=!S||x==="forward"?Math.max(1,y):1;return[Math.max(0,w-k),Math.max(0,Math.min(v-1,E+N)),w,E]},m})(g.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var lk=function(t,r){var n=t.children,s=t.direction,o=t.height,a=t.layout,i=t.innerTagName,c=t.outerTagName,u=t.width,d=r.instance;if(process.env.NODE_ENV!=="production"){(i!=null||c!=null)&&ra&&!ra.has(d)&&(ra.add(d),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var f=s==="horizontal"||a==="horizontal";switch(s){case"horizontal":case"vertical":ta&&!ta.has(d)&&(ta.add(d),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+s+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(n==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(n===null?"null":typeof n)+'" was specified.'));if(f&&typeof u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!f&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},ck=50,rs=function(t,r,n){var s=t,o=s.itemSize,a=n.itemMetadataMap,i=n.lastMeasuredIndex;if(r>i){var c=0;if(i>=0){var u=a[i];c=u.offset+u.size}for(var d=i+1;d<=r;d++){var f=o(d);a[d]={offset:c,size:f},c+=f}n.lastMeasuredIndex=r}return a[r]},uk=function(t,r,n){var s=r.itemMetadataMap,o=r.lastMeasuredIndex,a=o>0?s[o].offset:0;return a>=n?rm(t,r,o,0,n):dk(t,r,Math.max(0,o),n)},rm=function(t,r,n,s,o){for(;s<=n;){var a=s+Math.floor((n-s)/2),i=rs(t,a,r).offset;if(i===o)return a;i<o?s=a+1:i>o&&(n=a-1)}return s>0?s-1:0},dk=function(t,r,n,s){for(var o=t.itemCount,a=1;n<o&&rs(t,n,r).offset<s;)n+=a,a*=2;return rm(t,r,Math.min(n,o-1),Math.floor(n/2),s)},Ju=function(t,r){var n=t.itemCount,s=r.itemMetadataMap,o=r.estimatedItemSize,a=r.lastMeasuredIndex,i=0;if(a>=n&&(a=n-1),a>=0){var c=s[a];i=c.offset+c.size}var u=n-a-1,d=u*o;return i+d},fk=tm({getItemOffset:function(t,r,n){return rs(t,r,n).offset},getItemSize:function(t,r,n){return n.itemMetadataMap[r].size},getEstimatedTotalSize:Ju,getOffsetForIndexAndAlignment:function(t,r,n,s,o,a){var i=t.direction,c=t.height,u=t.layout,d=t.width,f=i==="horizontal"||u==="horizontal",m=f?d:c,h=rs(t,r,o),b=Ju(t,o),p=Math.max(0,Math.min(b-m,h.offset)),v=Math.max(0,h.offset-m+h.size+a);switch(n==="smart"&&(s>=v-m&&s<=p+m?n="auto":n="center"),n){case"start":return p;case"end":return v;case"center":return Math.round(v+(p-v)/2);case"auto":default:return s>=v&&s<=p?s:s<v?v:p}},getStartIndexForOffset:function(t,r,n){return uk(t,n,r)},getStopIndexForStartIndex:function(t,r,n,s){for(var o=t.direction,a=t.height,i=t.itemCount,c=t.layout,u=t.width,d=o==="horizontal"||c==="horizontal",f=d?u:a,m=rs(t,r,s),h=n+f,b=m.offset+m.size,p=r;p<i-1&&b<h;)p++,b+=rs(t,p,s).size;return p},initInstanceProps:function(t,r){var n=t,s=n.estimatedItemSize,o={itemMetadataMap:{},estimatedItemSize:s||ck,lastMeasuredIndex:-1};return r.resetAfterIndex=function(a,i){i===void 0&&(i=!0),o.lastMeasuredIndex=Math.min(o.lastMeasuredIndex,a-1),r._getItemStyleCache(-1),i&&r.forceUpdate()},o},shouldResetStyleCacheOnItemSizeChange:!1,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="function")throw Error('An invalid "itemSize" prop has been specified. Value should be a function. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}}),hk=tm({getItemOffset:function(t,r){var n=t.itemSize;return r*n},getItemSize:function(t,r){var n=t.itemSize;return n},getEstimatedTotalSize:function(t){var r=t.itemCount,n=t.itemSize;return n*r},getOffsetForIndexAndAlignment:function(t,r,n,s,o,a){var i=t.direction,c=t.height,u=t.itemCount,d=t.itemSize,f=t.layout,m=t.width,h=i==="horizontal"||f==="horizontal",b=h?m:c,p=Math.max(0,u*d-b),v=Math.min(p,r*d),y=Math.max(0,r*d-b+d+a);switch(n==="smart"&&(s>=y-b&&s<=v+b?n="auto":n="center"),n){case"start":return v;case"end":return y;case"center":{var C=Math.round(y+(v-y)/2);return C<Math.ceil(b/2)?0:C>p+Math.floor(b/2)?p:C}case"auto":default:return s>=y&&s<=v?s:s<y?y:v}},getStartIndexForOffset:function(t,r){var n=t.itemCount,s=t.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/s)))},getStopIndexForStartIndex:function(t,r,n){var s=t.direction,o=t.height,a=t.itemCount,i=t.itemSize,c=t.layout,u=t.width,d=s==="horizontal"||c==="horizontal",f=r*i,m=d?u:o,h=Math.ceil((m+n-f)/i);return Math.max(0,Math.min(a-1,r+h-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var r=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof r!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(r===null?"null":typeof r)+'" was specified.'))}});function pk(){var e,t;const r=Xt(),s=LE().cursor;if(!s||s.type!=="line")return null;const o=r.indent,a=r.rowTopPosition(s.index)+((t=(e=r.props.padding)!==null&&e!==void 0?e:r.props.paddingTop)!==null&&t!==void 0?t:0),i=o*s.level,c=r.renderCursor;return l.jsx(c,{top:a,left:i,indent:o})}var mk=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const gk=g.forwardRef(function(t,r){const{children:n}=t,s=mk(t,["children"]),o=Xt();return l.jsxs("div",Object.assign({ref:r},s,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[l.jsx(vk,{}),n]}))}),vk=()=>{const e=Xt();return l.jsx("div",{style:{height:e.rowTopPosition(e.visibleNodes.length),width:"100%",position:"absolute",left:"0",right:"0"},children:l.jsx(pk,{})})};var yk=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};const bk=g.forwardRef(function(t,r){var n,s,o,a,{style:i}=t,c=yk(t,["style"]);const u=Xt(),d=(s=(n=u.props.padding)!==null&&n!==void 0?n:u.props.paddingTop)!==null&&s!==void 0?s:0,f=(a=(o=u.props.padding)!==null&&o!==void 0?o:u.props.paddingBottom)!==null&&a!==void 0?a:0;return l.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},i),{height:`${parseFloat(i.height)+d+f}px`})},c))});var nm=g.createContext({dragDropManager:void 0}),gr;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(gr||(gr={}));function Ie(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!e){var o;if(t===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(t.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var gc="dnd-core/INIT_COORDS",Ja="dnd-core/BEGIN_DRAG",vc="dnd-core/PUBLISH_DRAG_SOURCE",ei="dnd-core/HOVER",ti="dnd-core/DROP",ri="dnd-core/END_DRAG";function ed(e,t){return{type:gc,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function na(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?na=function(r){return typeof r}:na=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},na(e)}function Ck(e,t,r){return t.split(".").reduce(function(n,s){return n&&n[s]?n[s]:r||null},e)}function Sk(e,t){return e.filter(function(r){return r!==t})}function sm(e){return na(e)==="object"}function xk(e,t){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o,a){o===1&&s.push(a)}),s}function _k(e,t){return e.filter(function(r){return t.indexOf(r)>-1})}var wk={type:gc,payload:{clientOffset:null,sourceClientOffset:null}};function Tk(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},s=n.publishSource,o=s===void 0?!0:s,a=n.clientOffset,i=n.getSourceClientOffset,c=e.getMonitor(),u=e.getRegistry();e.dispatch(ed(a)),Ek(r,c,u);var d=Lk(r,c);if(d===null){e.dispatch(wk);return}var f=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");kk(i),f=i(d)}e.dispatch(ed(a,f));var m=u.getSource(d),h=m.beginDrag(c,d);if(h!=null){Ak(h),u.pinSource(d);var b=u.getSourceType(d);return{type:Ja,payload:{itemType:b,item:h,sourceId:d,clientOffset:a||null,sourceClientOffset:f||null,isSourcePublic:!!o}}}}}function Ek(e,t,r){Ie(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(n){Ie(r.getSource(n),"Expected sourceIds to be registered.")})}function kk(e){Ie(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Ak(e){Ie(sm(e),"Item must be an object.")}function Lk(e,t){for(var r=null,n=e.length-1;n>=0;n--)if(t.canDragSource(e[n])){r=e[n];break}return r}function Ik(e){return function(){var r=e.getMonitor();if(r.isDragging())return{type:vc}}}function El(e,t){return t===null?e===null:Array.isArray(e)?e.some(function(r){return r===t}):e===t}function Dk(e){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.clientOffset;jk(r);var o=r.slice(0),a=e.getMonitor(),i=e.getRegistry();Ok(o,a,i);var c=a.getItemType();return Nk(o,i,c),Rk(o,a,i),{type:ei,payload:{targetIds:o,clientOffset:s||null}}}}function jk(e){Ie(Array.isArray(e),"Expected targetIds to be an array.")}function Ok(e,t,r){Ie(t.isDragging(),"Cannot call hover while not dragging."),Ie(!t.didDrop(),"Cannot call hover after drop.");for(var n=0;n<e.length;n++){var s=e[n];Ie(e.lastIndexOf(s)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(s);Ie(o,"Expected targetIds to be registered.")}}function Nk(e,t,r){for(var n=e.length-1;n>=0;n--){var s=e[n],o=t.getTargetType(s);El(o,r)||e.splice(n,1)}}function Rk(e,t,r){e.forEach(function(n){var s=r.getTarget(n);s.hover(t,n)})}function td(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function rd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?td(Object(r),!0).forEach(function(n){Pk(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):td(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fk(e){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.getMonitor(),s=e.getRegistry();Mk(n);var o=$k(n);o.forEach(function(a,i){var c=Bk(a,i,s,n),u={type:ti,payload:{dropResult:rd(rd({},r),c)}};e.dispatch(u)})}}function Mk(e){Ie(e.isDragging(),"Cannot call drop while not dragging."),Ie(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function Bk(e,t,r,n){var s=r.getTarget(e),o=s?s.drop(n,e):void 0;return qk(o),typeof o>"u"&&(o=t===0?{}:n.getDropResult()),o}function qk(e){Ie(typeof e>"u"||sm(e),"Drop result must either be an object or undefined.")}function $k(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Uk(e){return function(){var r=e.getMonitor(),n=e.getRegistry();Vk(r);var s=r.getSourceId();if(s!=null){var o=n.getSource(s,!0);o.endDrag(r,s),n.unpinSource()}return{type:ri}}}function Vk(e){Ie(e.isDragging(),"Cannot call endDrag while not dragging.")}function Hk(e){return{beginDrag:Tk(e),publishDragSource:Ik(e),hover:Dk(e),drop:Fk(e),endDrag:Uk(e)}}function zk(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qk(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wk(e,t,r){return t&&Qk(e.prototype,t),e}function Ps(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Gk=(function(){function e(t,r){var n=this;zk(this,e),Ps(this,"store",void 0),Ps(this,"monitor",void 0),Ps(this,"backend",void 0),Ps(this,"isSetUp",!1),Ps(this,"handleRefCountChange",function(){var s=n.store.getState().refCount>0;n.backend&&(s&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!s&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=t,this.monitor=r,t.subscribe(this.handleRefCountChange)}return Wk(e,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function s(a){return function(){for(var i=arguments.length,c=new Array(i),u=0;u<i;u++)c[u]=arguments[u];var d=a.apply(r,c);typeof d<"u"&&n(d)}}var o=Hk(this);return Object.keys(o).reduce(function(a,i){var c=o[i];return a[i]=s(c),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),e})();function dr(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var nd=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),sd=function(){return Math.random().toString(36).substring(7).split("").join(".")},od={INIT:"@@redux/INIT"+sd(),REPLACE:"@@redux/REPLACE"+sd()};function Kk(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Yk(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(Jk(e))return"date";if(Xk(e))return"error";var r=Zk(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function Zk(e){return typeof e.constructor=="function"?e.constructor.name:null}function Xk(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function Jk(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function Wn(e){var t=typeof e;return process.env.NODE_ENV!=="production"&&(t=Yk(e)),t}function om(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?dr(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?dr(1):"Expected the enhancer to be a function. Instead, received: '"+Wn(r)+"'");return r(om)(e,t)}if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?dr(2):"Expected the root reducer to be a function. Instead, received: '"+Wn(e)+"'");var s=e,o=t,a=[],i=a,c=!1;function u(){i===a&&(i=a.slice())}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?dr(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?dr(4):"Expected the listener to be a function. Instead, received: '"+Wn(p)+"'");if(c)throw new Error(process.env.NODE_ENV==="production"?dr(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return u(),i.push(p),function(){if(v){if(c)throw new Error(process.env.NODE_ENV==="production"?dr(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,u();var C=i.indexOf(p);i.splice(C,1),a=null}}}function m(p){if(!Kk(p))throw new Error(process.env.NODE_ENV==="production"?dr(7):"Actions must be plain objects. Instead, the actual type was: '"+Wn(p)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof p.type>"u")throw new Error(process.env.NODE_ENV==="production"?dr(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(c)throw new Error(process.env.NODE_ENV==="production"?dr(9):"Reducers may not dispatch actions.");try{c=!0,o=s(o,p)}finally{c=!1}for(var v=a=i,y=0;y<v.length;y++){var C=v[y];C()}return p}function h(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?dr(10):"Expected the nextReducer to be a function. Instead, received: '"+Wn(p));s=p,m({type:od.REPLACE})}function b(){var p,v=f;return p={subscribe:function(C){if(typeof C!="object"||C===null)throw new Error(process.env.NODE_ENV==="production"?dr(11):"Expected the observer to be an object. Instead, received: '"+Wn(C)+"'");function S(){C.next&&C.next(d())}S();var x=v(S);return{unsubscribe:x}}},p[nd]=function(){return this},p}return m({type:od.INIT}),n={dispatch:m,subscribe:f,getState:d,replaceReducer:h},n[nd]=b,n}var eA=function(t,r){return t===r};function tA(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function rA(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:eA;if(e.length!==t.length)return!1;for(var n=0;n<e.length;++n)if(!r(e[n],t[n]))return!1;return!0}function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function id(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ad(Object(r),!0).forEach(function(n){nA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ld={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function sA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ld,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case gc:case Ja:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case ei:return tA(e.clientOffset,r.clientOffset)?e:id(id({},e),{},{clientOffset:r.clientOffset});case ri:case ti:return ld;default:return e}}var yc="dnd-core/ADD_SOURCE",bc="dnd-core/ADD_TARGET",Cc="dnd-core/REMOVE_SOURCE",ni="dnd-core/REMOVE_TARGET";function oA(e){return{type:yc,payload:{sourceId:e}}}function aA(e){return{type:bc,payload:{targetId:e}}}function iA(e){return{type:Cc,payload:{sourceId:e}}}function lA(e){return{type:ni,payload:{targetId:e}}}function cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cd(Object(r),!0).forEach(function(n){cA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cd(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var uA={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function dA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uA,t=arguments.length>1?arguments[1]:void 0,r=t.payload;switch(t.type){case Ja:return fr(fr({},e),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case vc:return fr(fr({},e),{},{isSourcePublic:!0});case ei:return fr(fr({},e),{},{targetIds:r.targetIds});case ni:return e.targetIds.indexOf(r.targetId)===-1?e:fr(fr({},e),{},{targetIds:Sk(e.targetIds,r.targetId)});case ti:return fr(fr({},e),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case ri:return fr(fr({},e),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function fA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case yc:case bc:return e+1;case Cc:case ni:return e-1;default:return e}}var wa=[],Sc=[];wa.__IS_NONE__=!0;Sc.__IS_ALL__=!0;function hA(e,t){if(e===wa)return!1;if(e===Sc||typeof t>"u")return!0;var r=_k(t,e);return r.length>0}function pA(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ei:break;case yc:case bc:case ni:case Cc:return wa;case Ja:case vc:case ri:case ti:default:return Sc}var t=e.payload,r=t.targetIds,n=r===void 0?[]:r,s=t.prevTargetIds,o=s===void 0?[]:s,a=xk(n,o),i=a.length>0||!rA(n,o);if(!i)return wa;var c=o[o.length-1],u=n[n.length-1];return c!==u&&(c&&a.push(c),u&&a.push(u)),a}function mA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return e+1}function ud(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function dd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ud(Object(r),!0).forEach(function(n){gA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ud(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vA(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:pA(e.dirtyHandlerIds,{type:t.type,payload:dd(dd({},t.payload),{},{prevTargetIds:Ck(e,"dragOperation.targetIds",[])})}),dragOffset:sA(e.dragOffset,t),refCount:fA(e.refCount,t),dragOperation:dA(e.dragOperation,t),stateId:mA(e.stateId)}}function yA(e,t){return{x:e.x+t.x,y:e.y+t.y}}function am(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bA(e){var t=e.clientOffset,r=e.initialClientOffset,n=e.initialSourceClientOffset;return!t||!r||!n?null:am(yA(t,n),r)}function CA(e){var t=e.clientOffset,r=e.initialClientOffset;return!t||!r?null:am(t,r)}function SA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _A(e,t,r){return t&&xA(e.prototype,t),e}function fd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wA=(function(){function e(t,r){SA(this,e),fd(this,"store",void 0),fd(this,"registry",void 0),this.store=t,this.registry=r}return _A(e,[{key:"subscribeToStateChange",value:function(r){var n=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=s.handlerIds;Ie(typeof r=="function","listener must be a function."),Ie(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,i=function(){var u=n.store.getState(),d=u.stateId;try{var f=d===a||d===a+1&&!hA(u.dirtyHandlerIds,o);f||r()}finally{a=d}};return this.store.subscribe(i)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;Ie(typeof r=="function","listener must be a function.");var s=this.store.getState().dragOffset,o=function(){var i=n.store.getState().dragOffset;i!==s&&(s=i,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return Ie(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(Ie(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var s=this.registry.getTargetType(r),o=this.getItemType();return El(s,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(Ie(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var s=this.registry.getSourceType(r),o=this.getItemType();return s!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var s=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!El(o,a))return!1;var i=this.getTargetIds();if(!i.length)return!1;var c=i.indexOf(r);return s?c===i.length-1:c>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return bA(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return CA(this.store.getState().dragOffset)}}]),e})(),TA=0;function EA(){return TA++}function sa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sa=function(r){return typeof r}:sa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},sa(e)}function kA(e){Ie(typeof e.canDrag=="function","Expected canDrag to be a function."),Ie(typeof e.beginDrag=="function","Expected beginDrag to be a function."),Ie(typeof e.endDrag=="function","Expected endDrag to be a function.")}function AA(e){Ie(typeof e.canDrop=="function","Expected canDrop to be a function."),Ie(typeof e.hover=="function","Expected hover to be a function."),Ie(typeof e.drop=="function","Expected beginDrag to be a function.")}function kl(e,t){if(t&&Array.isArray(e)){e.forEach(function(r){return kl(r,!1)});return}Ie(typeof e=="string"||sa(e)==="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const hd=typeof global<"u"?global:self,im=hd.MutationObserver||hd.WebKitMutationObserver;function lm(e){return function(){const r=setTimeout(s,0),n=setInterval(s,50);function s(){clearTimeout(r),clearInterval(n),e()}}}function LA(e){let t=1;const r=new im(e),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){t=-t,n.data=t}}const IA=typeof im=="function"?LA:lm;class DA{enqueueTask(t){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const r=this.index;if(this.index++,t[r].call(),this.index>this.capacity){for(let n=0,s=t.length-this.index;n<s;n++)t[n]=t[n+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=IA(this.flush),this.requestErrorThrow=lm(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class jA{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,r){this.onError=t,this.release=r,this.task=null}}class OA{create(t){const r=this.freeTasks,n=r.length?r.pop():new jA(this.onError,s=>r[r.length]=s);return n.task=t,n}constructor(t){this.onError=t,this.freeTasks=[]}}const cm=new DA,NA=new OA(cm.registerPendingError);function RA(e){cm.enqueueTask(NA.create(e))}function PA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function MA(e,t,r){return t&&FA(e.prototype,t),e}function Gn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function BA(e,t){return VA(e)||UA(e,t)||$A(e,t)||qA()}function qA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
537
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $A(e,t){if(e){if(typeof e=="string")return pd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pd(e,t)}}function pd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function UA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function VA(e){if(Array.isArray(e))return e}function HA(e){var t=EA().toString();switch(e){case gr.SOURCE:return"S".concat(t);case gr.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}function md(e){switch(e[0]){case"S":return gr.SOURCE;case"T":return gr.TARGET;default:Ie(!1,"Cannot parse handler ID: ".concat(e))}}function gd(e,t){var r=e.entries(),n=!1;do{var s=r.next(),o=s.done,a=BA(s.value,2),i=a[1];if(i===t)return!0;n=!!o}while(!n);return!1}var zA=(function(){function e(t){PA(this,e),Gn(this,"types",new Map),Gn(this,"dragSources",new Map),Gn(this,"dropTargets",new Map),Gn(this,"pinnedSourceId",null),Gn(this,"pinnedSource",null),Gn(this,"store",void 0),this.store=t}return MA(e,[{key:"addSource",value:function(r,n){kl(r),kA(n);var s=this.addHandler(gr.SOURCE,r,n);return this.store.dispatch(oA(s)),s}},{key:"addTarget",value:function(r,n){kl(r,!0),AA(n);var s=this.addHandler(gr.TARGET,r,n);return this.store.dispatch(aA(s)),s}},{key:"containsHandler",value:function(r){return gd(this.dragSources,r)||gd(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Ie(this.isSourceId(r),"Expected a valid source ID.");var s=n&&r===this.pinnedSourceId,o=s?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return Ie(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return Ie(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return Ie(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=md(r);return n===gr.SOURCE}},{key:"isTargetId",value:function(r){var n=md(r);return n===gr.TARGET}},{key:"removeSource",value:function(r){var n=this;Ie(this.getSource(r),"Expected an existing source."),this.store.dispatch(iA(r)),RA(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){Ie(this.getTarget(r),"Expected an existing target."),this.store.dispatch(lA(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);Ie(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){Ie(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,s){var o=HA(r);return this.types.set(o,n),r===gr.SOURCE?this.dragSources.set(o,s):r===gr.TARGET&&this.dropTargets.set(o,s),o}}]),e})();function QA(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=WA(n),o=new wA(s,new zA(s)),a=new Gk(s,o),i=e(a,t,r);return a.receiveBackend(i),a}function WA(e){var t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return om(vA,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}var GA=["children"];function KA(e,t){return JA(e)||XA(e,t)||ZA(e,t)||YA()}function YA(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
538
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZA(e,t){if(e){if(typeof e=="string")return vd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vd(e,t)}}function vd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XA(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function JA(e){if(Array.isArray(e))return e}function eL(e,t){if(e==null)return{};var r=tL(e,t),n,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tL(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var yd=0,oa=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),rL=g.memo(function(t){var r=t.children,n=eL(t,GA),s=nL(n),o=KA(s,2),a=o[0],i=o[1];return g.useEffect(function(){if(i){var c=um();return++yd,function(){--yd===0&&(c[oa]=null)}}},[]),l.jsx(nm.Provider,Object.assign({value:a},{children:r}),void 0)});function nL(e){if("manager"in e){var t={dragDropManager:e.manager};return[t,!1]}var r=sL(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[r,n]}function sL(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:um(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,s=t;return s[oa]||(s[oa]={dragDropManager:QA(e,t,r,n)}),s[oa]}function um(){return typeof global<"u"?global:window}function oL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function aL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function iL(e,t,r){return t&&aL(e.prototype,t),e}function bd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var wi=!1,Ti=!1,lL=(function(){function e(t){oL(this,e),bd(this,"internalMonitor",void 0),bd(this,"sourceId",null),this.internalMonitor=t.getMonitor()}return iL(e,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){Ie(!wi,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return wi=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{wi=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;Ie(!Ti,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ti=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ti=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function cL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dL(e,t,r){return t&&uL(e.prototype,t),e}function Cd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ei=!1,fL=(function(){function e(t){cL(this,e),Cd(this,"internalMonitor",void 0),Cd(this,"targetId",null),this.internalMonitor=t.getMonitor()}return dL(e,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;Ie(!Ei,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ei=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ei=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),e})();function hL(e){if(typeof e.type!="string"){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function pL(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!g.isValidElement(t)){var n=t;return e(n,r),n}var s=t;hL(s);var o=r?function(a){return e(a,r)}:e;return mL(s,o)}}function dm(e){var t={};return Object.keys(e).forEach(function(r){var n=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var s=pL(n);t[r]=function(){return s}}}),t}function Sd(e,t){typeof e=="function"?e(t):e.current=t}function mL(e,t){var r=e.ref;return Ie(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?g.cloneElement(e,{ref:function(s){Sd(r,s),Sd(t,s)}}):g.cloneElement(e,{ref:t})}function aa(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?aa=function(r){return typeof r}:aa=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},aa(e)}function Al(e){return e!==null&&aa(e)==="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ll(e,t,r,n){var s=void 0;if(s!==void 0)return!!s;if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var i=Object.prototype.hasOwnProperty.bind(t),c=0;c<o.length;c++){var u=o[c];if(!i(u))return!1;var d=e[u],f=t[u];if(s=void 0,s===!1||s===void 0&&d!==f)return!1}return!0}function gL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yL(e,t,r){return t&&vL(e.prototype,t),e}function Ot(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bL=(function(){function e(t){var r=this;gL(this,e),Ot(this,"hooks",dm({dragSource:function(s,o){r.clearDragSource(),r.dragSourceOptions=o||null,Al(s)?r.dragSourceRef=s:r.dragSourceNode=s,r.reconnectDragSource()},dragPreview:function(s,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,Al(s)?r.dragPreviewRef=s:r.dragPreviewNode=s,r.reconnectDragPreview()}})),Ot(this,"handlerId",null),Ot(this,"dragSourceRef",null),Ot(this,"dragSourceNode",void 0),Ot(this,"dragSourceOptionsInternal",null),Ot(this,"dragSourceUnsubscribe",void 0),Ot(this,"dragPreviewRef",null),Ot(this,"dragPreviewNode",void 0),Ot(this,"dragPreviewOptionsInternal",null),Ot(this,"dragPreviewUnsubscribe",void 0),Ot(this,"lastConnectedHandlerId",null),Ot(this,"lastConnectedDragSource",null),Ot(this,"lastConnectedDragSourceOptions",null),Ot(this,"lastConnectedDragPreview",null),Ot(this,"lastConnectedDragPreviewOptions",null),Ot(this,"backend",void 0),this.backend=t}return yL(e,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ll(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ll(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),e})();function CL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xL(e,t,r){return t&&SL(e.prototype,t),e}function Ir(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _L=(function(){function e(t){var r=this;CL(this,e),Ir(this,"hooks",dm({dropTarget:function(s,o){r.clearDropTarget(),r.dropTargetOptions=o,Al(s)?r.dropTargetRef=s:r.dropTargetNode=s,r.reconnect()}})),Ir(this,"handlerId",null),Ir(this,"dropTargetRef",null),Ir(this,"dropTargetNode",void 0),Ir(this,"dropTargetOptionsInternal",null),Ir(this,"unsubscribeDropTarget",void 0),Ir(this,"lastConnectedHandlerId",null),Ir(this,"lastConnectedDropTarget",null),Ir(this,"lastConnectedDropTargetOptions",null),Ir(this,"backend",void 0),this.backend=t}return xL(e,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ll(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),e})();function wL(e,t,r){var n=r.getRegistry(),s=n.addTarget(e,t);return[s,function(){return n.removeTarget(s)}]}function TL(e,t,r){var n=r.getRegistry(),s=n.addSource(e,t);return[s,function(){return n.removeSource(s)}]}var Un=typeof window<"u"?g.useLayoutEffect:g.useEffect;function ia(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ia=function(r){return typeof r}:ia=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ia(e)}function EL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function AL(e,t,r){return t&&kL(e.prototype,t),e}function ki(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var LL=(function(){function e(t,r,n){EL(this,e),ki(this,"spec",void 0),ki(this,"monitor",void 0),ki(this,"connector",void 0),this.spec=t,this.monitor=r,this.connector=n}return AL(e,[{key:"beginDrag",value:function(){var r,n=this.spec,s=this.monitor,o=null;return ia(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(s):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var s=this.spec,o=this.monitor,a=s.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,s=this.connector,o=r.end;o&&o(n.getItem(),n),s.reconnect()}}]),e})();function IL(e,t,r){var n=g.useMemo(function(){return new LL(e,t,r)},[t,r]);return g.useEffect(function(){n.spec=e},[e]),n}function Vn(){var e=g.useContext(nm),t=e.dragDropManager;return Ie(t!=null,"Expected drag drop context"),t}function DL(e){return g.useMemo(function(){var t=e.type;return Ie(t!=null,"spec.type must be defined"),t},[e])}function jL(e,t){return PL(e)||RL(e,t)||NL(e,t)||OL()}function OL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
539
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NL(e,t){if(e){if(typeof e=="string")return xd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xd(e,t)}}function xd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function RL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function PL(e){if(Array.isArray(e))return e}function FL(e,t,r){var n=Vn(),s=IL(e,t,r),o=DL(e);Un(function(){if(o!=null){var i=TL(o,s,n),c=jL(i,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d}},[n,t,r,s,o])}function ML(e){return UL(e)||$L(e)||qL(e)||BL()}function BL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
540
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qL(e,t){if(e){if(typeof e=="string")return Il(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Il(e,t)}}function $L(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UL(e){if(Array.isArray(e))return Il(e)}function Il(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function fm(e,t){var r=ML(t||[]);return t==null&&typeof e!="function"&&r.push(e),g.useMemo(function(){return typeof e=="function"?e():e},r)}function VL(){var e=Vn();return g.useMemo(function(){return new lL(e)},[e])}function HL(e,t){var r=Vn(),n=g.useMemo(function(){return new bL(r.getBackend())},[r]);return Un(function(){return n.dragSourceOptions=e||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,e]),Un(function(){return n.dragPreviewOptions=t||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,t]),n}var Ai,_d;function zL(){return _d||(_d=1,Ai=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,o;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var a=o[s];if(!e(t[a],r[a]))return!1}return!0}return t!==t&&r!==r}),Ai}var QL=zL();const WL=Jl(QL);function GL(e,t){return XL(e)||ZL(e,t)||YL(e,t)||KL()}function KL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
541
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YL(e,t){if(e){if(typeof e=="string")return wd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wd(e,t)}}function wd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ZL(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function XL(e){if(Array.isArray(e))return e}function hm(e,t,r){var n=g.useState(function(){return t(e)}),s=GL(n,2),o=s[0],a=s[1],i=g.useCallback(function(){var c=t(e);WL(o,c)||(a(c),r&&r())},[o,e,r]);return Un(i),[o,i]}function JL(e,t){return nI(e)||rI(e,t)||tI(e,t)||eI()}function eI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
542
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tI(e,t){if(e){if(typeof e=="string")return Td(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Td(e,t)}}function Td(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function rI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function nI(e){if(Array.isArray(e))return e}function sI(e,t,r){var n=hm(e,t,r),s=JL(n,2),o=s[0],a=s[1];return Un(function(){var c=e.getHandlerId();if(c!=null)return e.subscribeToStateChange(a,{handlerIds:[c]})},[e,a]),o}function pm(e,t,r){return sI(t,e||function(){return{}},function(){return r.reconnect()})}function oI(e){return g.useMemo(function(){return e.hooks.dragSource()},[e])}function aI(e){return g.useMemo(function(){return e.hooks.dragPreview()},[e])}function iI(e,t){var r=fm(e,t);Ie(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=VL(),s=HL(r.options,r.previewOptions);return FL(r,n,s),[pm(r.collect,n,s),oI(s),aI(s)]}function lI(e){var t=e.accept;return g.useMemo(function(){return Ie(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]},[t])}function cI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function uI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dI(e,t,r){return t&&uI(e.prototype,t),e}function Ed(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var fI=(function(){function e(t,r){cI(this,e),Ed(this,"spec",void 0),Ed(this,"monitor",void 0),this.spec=t,this.monitor=r}return dI(e,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),e})();function hI(e,t){var r=g.useMemo(function(){return new fI(e,t)},[t]);return g.useEffect(function(){r.spec=e},[e]),r}function pI(e,t){return yI(e)||vI(e,t)||gI(e,t)||mI()}function mI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
543
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gI(e,t){if(e){if(typeof e=="string")return kd(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kd(e,t)}}function kd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function vI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function yI(e){if(Array.isArray(e))return e}function bI(e,t,r){var n=Vn(),s=hI(e,t),o=lI(e);Un(function(){var i=wL(o,s,n),c=pI(i,2),u=c[0],d=c[1];return t.receiveHandlerId(u),r.receiveHandlerId(u),d},[n,t,s,r,o.map(function(a){return a.toString()}).join("|")])}function CI(){var e=Vn();return g.useMemo(function(){return new fL(e)},[e])}function SI(e){var t=Vn(),r=g.useMemo(function(){return new _L(t.getBackend())},[t]);return Un(function(){return r.dropTargetOptions=e||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[e]),r}function xI(e){return g.useMemo(function(){return e.hooks.dropTarget()},[e])}function mm(e,t){var r=fm(e,t),n=CI(),s=SI(r.options);return bI(r,n,s),[pm(r.collect,n,s),xI(s)]}function _I(e,t){return kI(e)||EI(e,t)||TI(e,t)||wI()}function wI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
544
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TI(e,t){if(e){if(typeof e=="string")return Ad(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ad(e,t)}}function Ad(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function EI(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],s=!0,o=!1,a,i;try{for(r=r.call(e);!(s=(a=r.next()).done)&&(n.push(a.value),!(t&&n.length===t));s=!0);}catch(c){o=!0,i=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(o)throw i}}return n}}function kI(e){if(Array.isArray(e))return e}function AI(e){var t=Vn(),r=t.getMonitor(),n=hm(r,e),s=_I(n,2),o=s[0],a=s[1];return g.useEffect(function(){return r.subscribeToOffsetChange(a)}),g.useEffect(function(){return r.subscribeToStateChange(a)}),o}function gm(e){var t=null,r=function(){return t==null&&(t=e()),t};return r}function LI(e,t){return e.filter(function(r){return r!==t})}function II(e,t){var r=new Set,n=function(a){return r.add(a)};e.forEach(n),t.forEach(n);var s=[];return r.forEach(function(o){return s.push(o)}),s}function DI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function OI(e,t,r){return t&&jI(e.prototype,t),e}function Ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var NI=(function(){function e(t){DI(this,e),Ld(this,"entered",[]),Ld(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}return OI(e,[{key:"enter",value:function(r){var n=this,s=this.entered.length,o=function(i){return n.isNodeInDocument(i)&&(!i.contains||i.contains(r))};return this.entered=II(this.entered.filter(o),[r]),s===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=LI(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),e})(),RI=gm(function(){return/firefox/i.test(navigator.userAgent)}),vm=gm(function(){return!!window.safari});function PI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function MI(e,t,r){return t&&FI(e.prototype,t),e}function Fs(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Id=(function(){function e(t,r){PI(this,e),Fs(this,"xs",void 0),Fs(this,"ys",void 0),Fs(this,"c1s",void 0),Fs(this,"c2s",void 0),Fs(this,"c3s",void 0);for(var n=t.length,s=[],o=0;o<n;o++)s.push(o);s.sort(function(k,N){return t[k]<t[N]?-1:1});for(var a=[],i=[],c,u,d=0;d<n-1;d++)c=t[d+1]-t[d],u=r[d+1]-r[d],a.push(c),i.push(u/c);for(var f=[i[0]],m=0;m<a.length-1;m++){var h=i[m],b=i[m+1];if(h*b<=0)f.push(0);else{c=a[m];var p=a[m+1],v=c+p;f.push(3*v/((v+p)/h+(v+c)/b))}}f.push(i[i.length-1]);for(var y=[],C=[],S,x=0;x<f.length-1;x++){S=i[x];var _=f[x],w=1/a[x],E=_+f[x+1]-S-S;y.push((S-_-E)*w),C.push(E*w*w)}this.xs=t,this.ys=r,this.c1s=f,this.c2s=y,this.c3s=C}return MI(e,[{key:"interpolate",value:function(r){var n=this.xs,s=this.ys,o=this.c1s,a=this.c2s,i=this.c3s,c=n.length-1;if(r===n[c])return s[c];for(var u=0,d=i.length-1,f;u<=d;){f=Math.floor(.5*(u+d));var m=n[f];if(m<r)u=f+1;else if(m>r)d=f-1;else return s[f]}c=Math.max(0,d);var h=r-n[c],b=h*h;return s[c]+o[c]*h+a[c]*b+i[c]*h*b}}]),e})(),BI=1;function ym(e){var t=e.nodeType===BI?e:e.parentElement;if(!t)return null;var r=t.getBoundingClientRect(),n=r.top,s=r.left;return{x:s,y:n}}function Mo(e){return{x:e.clientX,y:e.clientY}}function qI(e){var t;return e.nodeName==="IMG"&&(RI()||!((t=document.documentElement)!==null&&t!==void 0&&t.contains(e)))}function $I(e,t,r,n){var s=e?t.width:r,o=e?t.height:n;return vm()&&e&&(o/=window.devicePixelRatio,s/=window.devicePixelRatio),{dragPreviewWidth:s,dragPreviewHeight:o}}function UI(e,t,r,n,s){var o=qI(t),a=o?e:t,i=ym(a),c={x:r.x-i.x,y:r.y-i.y},u=e.offsetWidth,d=e.offsetHeight,f=n.anchorX,m=n.anchorY,h=$I(o,t,u,d),b=h.dragPreviewWidth,p=h.dragPreviewHeight,v=function(){var E=new Id([0,.5,1],[c.y,c.y/d*p,c.y+p-d]),k=E.interpolate(m);return vm()&&o&&(k+=(window.devicePixelRatio-1)*p),k},y=function(){var E=new Id([0,.5,1],[c.x,c.x/u*b,c.x+b-u]);return E.interpolate(f)},C=s.offsetX,S=s.offsetY,x=C===0||C,_=S===0||S;return{x:x?C:y(),y:_?S:v()}}var bm="__NATIVE_FILE__",Cm="__NATIVE_URL__",Sm="__NATIVE_TEXT__",xm="__NATIVE_HTML__";const Dd=Object.freeze(Object.defineProperty({__proto__:null,FILE:bm,HTML:xm,TEXT:Sm,URL:Cm},Symbol.toStringTag,{value:"Module"}));function Li(e,t,r){var n=t.reduce(function(s,o){return s||e.getData(o)},"");return n??r}var Kn;function Bo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Dl=(Kn={},Bo(Kn,bm,{exposeProperties:{files:function(t){return Array.prototype.slice.call(t.files)},items:function(t){return t.items},dataTransfer:function(t){return t}},matchesTypes:["Files"]}),Bo(Kn,xm,{exposeProperties:{html:function(t,r){return Li(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Html","text/html"]}),Bo(Kn,Cm,{exposeProperties:{urls:function(t,r){return Li(t,r,"").split(`
545
+ `)},dataTransfer:function(t){return t}},matchesTypes:["Url","text/uri-list"]}),Bo(Kn,Sm,{exposeProperties:{text:function(t,r){return Li(t,r,"")},dataTransfer:function(t){return t}},matchesTypes:["Text","text/plain"]}),Kn);function VI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function zI(e,t,r){return t&&HI(e.prototype,t),e}function jd(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var QI=(function(){function e(t){VI(this,e),jd(this,"item",void 0),jd(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}return zI(e,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var s={};Object.keys(this.config.exposeProperties).forEach(function(o){s[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,s)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),e})();function WI(e,t){var r=new QI(Dl[e]);return r.loadDataTransfer(t),r}function Ii(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(Dl).filter(function(r){var n=Dl[r].matchesTypes;return n.some(function(s){return t.indexOf(s)>-1})})[0]||null}function GI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function KI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function YI(e,t,r){return t&&KI(e.prototype,t),e}function Di(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ZI=(function(){function e(t,r){GI(this,e),Di(this,"ownerDocument",null),Di(this,"globalContext",void 0),Di(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=r}return YI(e,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),e})();function Od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Nd(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Od(Object(r),!0).forEach(function(n){Fe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Od(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XI(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function JI(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eD(e,t,r){return t&&JI(e.prototype,t),e}function Fe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tD=(function(){function e(t,r,n){var s=this;XI(this,e),Fe(this,"options",void 0),Fe(this,"actions",void 0),Fe(this,"monitor",void 0),Fe(this,"registry",void 0),Fe(this,"enterLeaveCounter",void 0),Fe(this,"sourcePreviewNodes",new Map),Fe(this,"sourcePreviewNodeOptions",new Map),Fe(this,"sourceNodes",new Map),Fe(this,"sourceNodeOptions",new Map),Fe(this,"dragStartSourceIds",null),Fe(this,"dropTargetIds",[]),Fe(this,"dragEnterTargetIds",[]),Fe(this,"currentNativeSource",null),Fe(this,"currentNativeHandle",null),Fe(this,"currentDragSourceNode",null),Fe(this,"altKeyPressed",!1),Fe(this,"mouseMoveTimeoutTimer",null),Fe(this,"asyncEndDragFrameId",null),Fe(this,"dragOverTargetIds",null),Fe(this,"lastClientOffset",null),Fe(this,"hoverRafId",null),Fe(this,"getSourceClientOffset",function(o){var a=s.sourceNodes.get(o);return a&&ym(a)||null}),Fe(this,"endDragNativeItem",function(){s.isDraggingNativeItem()&&(s.actions.endDrag(),s.currentNativeHandle&&s.registry.removeSource(s.currentNativeHandle),s.currentNativeHandle=null,s.currentNativeSource=null)}),Fe(this,"isNodeInDocument",function(o){return!!(o&&s.document&&s.document.body&&s.document.body.contains(o))}),Fe(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=s.currentDragSourceNode;o==null||s.isNodeInDocument(o)||s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Fe(this,"handleTopDragStartCapture",function(){s.clearCurrentDragSourceNode(),s.dragStartSourceIds=[]}),Fe(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=s.dragStartSourceIds;s.dragStartSourceIds=null;var i=Mo(o);s.monitor.isDragging()&&s.actions.endDrag(),s.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:s.getSourceClientOffset,clientOffset:i});var c=o.dataTransfer,u=Ii(c);if(s.monitor.isDragging()){if(c&&typeof c.setDragImage=="function"){var d=s.monitor.getSourceId(),f=s.sourceNodes.get(d),m=s.sourcePreviewNodes.get(d)||f;if(m){var h=s.getCurrentSourcePreviewNodeOptions(),b=h.anchorX,p=h.anchorY,v=h.offsetX,y=h.offsetY,C={anchorX:b,anchorY:p},S={offsetX:v,offsetY:y},x=UI(f,m,i,C,S);c.setDragImage(m,x.x,x.y)}}try{c==null||c.setData("application/json",{})}catch{}s.setCurrentDragSourceNode(o.target);var _=s.getCurrentSourcePreviewNodeOptions(),w=_.captureDraggingState;w?s.actions.publishDragSource():setTimeout(function(){return s.actions.publishDragSource()},0)}else if(u)s.beginDragNativeItem(u);else{if(c&&!c.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),Fe(this,"handleTopDragEndCapture",function(){s.clearCurrentDragSourceNode()&&s.monitor.isDragging()&&s.actions.endDrag()}),Fe(this,"handleTopDragEnterCapture",function(o){s.dragEnterTargetIds=[];var a=s.enterLeaveCounter.enter(o.target);if(!(!a||s.monitor.isDragging())){var i=o.dataTransfer,c=Ii(i);c&&s.beginDragNativeItem(c,i)}}),Fe(this,"handleTopDragEnter",function(o){var a=s.dragEnterTargetIds;if(s.dragEnterTargetIds=[],!!s.monitor.isDragging()){s.altKeyPressed=o.altKey,a.length>0&&s.actions.hover(a,{clientOffset:Mo(o)});var i=a.some(function(c){return s.monitor.canDropOnTarget(c)});i&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect()))}}),Fe(this,"handleTopDragOverCapture",function(){s.dragOverTargetIds=[]}),Fe(this,"handleTopDragOver",function(o){var a=s.dragOverTargetIds;if(s.dragOverTargetIds=[],!s.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}s.altKeyPressed=o.altKey,s.lastClientOffset=Mo(o),s.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(s.hoverRafId=requestAnimationFrame(function(){s.monitor.isDragging()&&s.actions.hover(a||[],{clientOffset:s.lastClientOffset}),s.hoverRafId=null}));var i=(a||[]).some(function(c){return s.monitor.canDropOnTarget(c)});i?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=s.getCurrentDropEffect())):s.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),Fe(this,"handleTopDragLeaveCapture",function(o){s.isDraggingNativeItem()&&o.preventDefault();var a=s.enterLeaveCounter.leave(o.target);a&&s.isDraggingNativeItem()&&setTimeout(function(){return s.endDragNativeItem()},0)}),Fe(this,"handleTopDropCapture",function(o){if(s.dropTargetIds=[],s.isDraggingNativeItem()){var a;o.preventDefault(),(a=s.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else Ii(o.dataTransfer)&&o.preventDefault();s.enterLeaveCounter.reset()}),Fe(this,"handleTopDrop",function(o){var a=s.dropTargetIds;s.dropTargetIds=[],s.actions.hover(a,{clientOffset:Mo(o)}),s.actions.drop({dropEffect:s.getCurrentDropEffect()}),s.isDraggingNativeItem()?s.endDragNativeItem():s.monitor.isDragging()&&s.actions.endDrag()}),Fe(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new ZI(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new NI(this.isNodeInDocument)}return eD(e,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,s){var o=this;return this.sourcePreviewNodeOptions.set(r,s),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,s){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,s);var a=function(u){return o.handleDragStart(u,r)},i=function(u){return o.handleSelectStart(u)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",i),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",i),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var s=this,o=function(u){return s.handleDragEnter(u,r)},a=function(u){return s.handleDragOver(u,r)},i=function(u){return s.handleDrop(u,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",i),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Nd({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Nd({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Dd).some(function(n){return Dd[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=WI(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var s=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},s)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),e})(),qo;function rD(){return qo||(qo=new Image,qo.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),qo}var nD=function(t,r,n){return new tD(t,r,n)};function sD(e,t){return typeof e=="function"?e(t):e??"NODE"}function oD(e){return e.isDraggable&&!e.isEditing}function aD(e){const t=Xt(),r=t.selectedIds,[n,s,o]=iI(()=>({canDrag:()=>oD(e),type:sD(t.props.dragType,e),item:()=>{const a=t.isSelected(e.id)?Array.from(r):[e.id];return t.dispatch(xs.dragStart(e.id,a)),{id:e.id,dragIds:a,data:e.data}},end:()=>{t.hideCursor(),t.redrawList(),t.dispatch(xs.dragEnd())}}),[r,e,t.props.dragType]);return g.useEffect(()=>{o(rD())},[o]),s}function iD(e,t){const r=e.getBoundingClientRect(),n=t.x-Math.round(r.x),s=t.y-Math.round(r.y),o=r.height,a=s<o/2,i=!a,c=o/4,u=s>c&&s<o-c;return{x:n,inTopHalf:a,inBottomHalf:i,inMiddle:u,atTop:!u&&a,atBottom:!u&&i}}function lD(e,t,r,n){return e?e.isInternal?n.atTop?[t,e]:n.inMiddle?[e,e]:[e,r]:n.inTopHalf?[t,e]:[e,r]:[t,null]}function $o(e,t){return{parentId:e||null,index:t}}function Yn(e,t){return{type:"line",index:e,level:t}}function cD(e){return{type:"highlight",id:e}}function ji(e,t){var r;let n=e;for(;n.parent&&n.level>t;)n=n.parent;const s=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=Wp(n)+1;return{parentId:s,index:o}}function _m(e){var t;const r=iD(e.element,e.offset),n=e.indent,s=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:i}=e,[c,u]=lD(o,i,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:$o(o.id,null),cursor:cD(o.id)};if(!c)return{drop:$o((t=u==null?void 0:u.parent)===null||t===void 0?void 0:t.id,0),cursor:Yn(0,0)};if(Vp(c)){const d=ea(s,(u==null?void 0:u.level)||0,c.level);return{drop:ji(c,d),cursor:Yn(c.rowIndex+1,d)}}if(Hp(c)){const d=ea(s,(u==null?void 0:u.level)||0,c.level);return{drop:ji(c,d),cursor:Yn(c.rowIndex+1,d)}}if(zp(c)){const d=ea(s,0,c.level+1);return d>c.level?{drop:$o(c.id,0),cursor:Yn(c.rowIndex+1,d)}:{drop:ji(c,d),cursor:Yn(c.rowIndex+1,d)}}return{drop:$o(c==null?void 0:c.id,0),cursor:Yn(c.rowIndex+1,c.level+1)}}function uD(e,t){const r=Xt(),[n,s]=mm(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const i=a.getClientOffset();if(!e.current||!i)return;const{cursor:c,drop:u}=_m({element:e.current,offset:i,indent:r.indent,node:t,prevNode:t.prev,nextNode:t.next});u&&r.dispatch(xs.hovering(u.parentId,u.index)),a.canDrop()?c&&r.showCursor(c):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;r.drop()}}),[t,e.current,r.props]);return s}function dD(e){const t=Xt(),r=t.at(e);if(!r)throw new Error(`Could not find node for index: ${e}`);return g.useMemo(()=>{const n=r.clone();return t.visibleNodes[e]=n,n},[...Object.values(r.state),r])}const Rd=g.memo(function({index:t,style:r}){Up(),AE();const n=Xt(),s=dD(t),o=g.useRef(null),a=aD(s),i=uD(o,s),c=g.useCallback(p=>{o.current=p,i(p)},[i]),u=n.indent*s.level,d=g.useMemo(()=>({paddingLeft:u}),[u]),f=g.useMemo(()=>{var p,v;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((v=(p=n.props.padding)!==null&&p!==void 0?p:n.props.paddingTop)!==null&&v!==void 0?v:0),minWidth:"max-content"})},[r,n.props.padding,n.props.paddingTop]),m={role:"treeitem","aria-level":s.level+1,"aria-selected":s.isSelected,"aria-expanded":s.isOpen,style:f,tabIndex:-1,className:n.props.rowClassName};g.useEffect(()=>{var p;!s.isEditing&&s.isFocused&&((p=o.current)===null||p===void 0||p.focus({preventScroll:!0}))},[s.isEditing,s.isFocused,o.current]);const h=n.renderNode,b=n.renderRow;return l.jsx(b,{node:s,innerRef:c,attrs:m,children:l.jsx(h,{node:s,tree:n,style:d,dragHandle:a})})});let Oi="",Pd=null;function wm(){Up();const e=Xt();return l.jsx("div",{role:"tree","aria-label":e.props["aria-label"],"aria-labelledby":e.props["aria-labelledby"],"aria-multiselectable":!e.props.disableMultiSelection||void 0,style:{height:e.height,width:e.width,minHeight:0,minWidth:0},onContextMenu:e.props.onContextMenu,onClick:e.props.onClick,tabIndex:0,onFocus:t=>{t.currentTarget.contains(t.relatedTarget)||e.onFocus()},onBlur:t=>{t.currentTarget.contains(t.relatedTarget)||e.onBlur()},onKeyDown:t=>{var r;if(e.isEditing)return;if(t.key==="Backspace"){if(!e.props.onDelete)return;const s=Array.from(e.selectedIds);if(s.length>1){let o=e.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=e.lastNode),e.focus(o,{scroll:!1}),e.delete(Array.from(s))}else{const o=e.focusedNode;if(o){const a=o.nextSibling,i=o.parent;e.focus(a||i,{scroll:!1}),e.delete(o)}}return}if(t.key==="Tab"&&!t.shiftKey){t.preventDefault(),Gp(t.currentTarget);return}if(t.key==="Tab"&&t.shiftKey){t.preventDefault(),Kp(t.currentTarget);return}if(t.key==="ArrowDown"){t.preventDefault();const s=e.nextNode;if(t.metaKey){e.select(e.focusedNode),e.activate(e.focusedNode);return}else if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.firstNode);return}}if(t.key==="ArrowUp"){t.preventDefault();const s=e.prevNode;if(!t.shiftKey||e.props.disableMultiSelection){e.focus(s);return}else{if(!s)return;const o=e.focusedNode;o?o.isSelected?e.selectContiguous(s):e.selectMulti(s):e.focus(e.lastNode);return}}if(t.key==="ArrowRight"){const s=e.focusedNode;if(!s)return;s.isInternal&&s.isOpen?e.focus(e.nextNode):s.isInternal&&e.open(s.id);return}if(t.key==="ArrowLeft"){const s=e.focusedNode;if(!s||s.isRoot)return;s.isInternal&&s.isOpen?e.close(s.id):!((r=s.parent)===null||r===void 0)&&r.isRoot||e.focus(s.parent);return}if(t.key==="a"&&(t.metaKey||t.ctrlKey)&&!e.props.disableMultiSelection){t.preventDefault(),e.selectAll();return}if(t.key==="a"&&!t.metaKey&&!t.ctrlKey&&e.props.onCreate){e.createLeaf();return}if(t.key==="A"&&!t.metaKey&&!t.ctrlKey){if(!e.props.onCreate)return;e.createInternal();return}if(t.key==="Home"){t.preventDefault(),e.focus(e.firstNode);return}if(t.key==="End"){t.preventDefault(),e.focus(e.lastNode);return}if(t.key==="Enter"){const s=e.focusedNode;if(!s||!s.isEditable||!e.props.onRename)return;setTimeout(()=>{s&&e.edit(s)});return}if(t.key===" "){t.preventDefault();const s=e.focusedNode;if(!s)return;s.isLeaf?(s.select(),s.activate()):s.toggle();return}if(t.key==="*"){const s=e.focusedNode;if(!s)return;e.openSiblings(s);return}if(t.key==="PageUp"){t.preventDefault(),e.pageUp();return}t.key==="PageDown"&&(t.preventDefault(),e.pageDown()),clearTimeout(Pd),Oi+=t.key,Pd=setTimeout(()=>{Oi=""},600);const n=e.visibleNodes.find(s=>{const o=s.data.name;return typeof o=="string"?o.toLowerCase().startsWith(Oi):!1});n&&e.focus(n.id)},children:l.jsx(fD,{})})}function fD(){var e,t;const r=Xt(),n={className:r.props.className,outerRef:r.listEl,itemCount:r.visibleNodes.length,height:r.height,width:r.width,overscanCount:r.overscanCount,itemKey:s=>{var o;return((o=r.visibleNodes[s])===null||o===void 0?void 0:o.id)||s},outerElementType:(e=r.props.outerElementType)!==null&&e!==void 0?e:gk,innerElementType:(t=r.props.innerElementType)!==null&&t!==void 0?t:bk,onScroll:r.props.onScroll,onItemsRendered:r.onItemsRendered.bind(r)};return typeof r.props.rowHeight=="function"?l.jsx(fk,Object.assign({},n,{itemSize:r.rowHeightAt,ref:r.list,children:Rd})):l.jsx(hk,Object.assign({},n,{itemSize:r.rowHeight,ref:r.list,children:Rd}))}function Fd(e){return e.isFiltered?pD(e.root,e.isMatch.bind(e)):hD(e.root)}function hD(e){const t=[];function r(n){var s;n.level>=0&&t.push(n),n.isOpen&&((s=n.children)===null||s===void 0||s.forEach(r))}return r(e),t.forEach(Tm),t}function pD(e,t){const r={},n=[];function s(a){if(!a.isRoot&&t(a)){r[a.id]=!0;let c=a.parent;for(;c;)r[c.id]=!0,c=c.parent}if(a.children)for(let c of a.children)s(c)}function o(a){var i;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((i=a.children)===null||i===void 0||i.forEach(o))}return s(e),o(e),n.forEach(Tm),n}function Tm(e,t){e.rowIndex=t}const Md=e=>e.reduce((t,r,n)=>(t[r.id]=n,t),{});var Ni=function(e,t,r,n){function s(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function i(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):s(d.value).then(i,c)}u((n=n.apply(e,t||[])).next())})};const{safeRun:Nt}=OE;class Ks{constructor(t,r,n,s){this.store=t,this.props=r,this.list=n,this.listEl=s,this.visibleStartIndex=0,this.visibleStopIndex=0,this.rowOffsets=null,this.rowHeightAt=o=>{const a=this.props.rowHeight;if(typeof a=="function"){const i=this.at(o);return i?a(i):this.rowHeight}return a??24},this.rowTopPosition=o=>{if(typeof this.props.rowHeight!="function")return o*this.rowHeight;const a=this.getRowOffsets(),i=Math.max(0,Math.min(o,a.length-1));return a[i]},this.redrawList=(o=0)=>{this.rowOffsets=null;const a=this.list.current;a&&"resetAfterIndex"in a&&a.resetAfterIndex(Math.max(0,o))},this.root=zu(this),this.visibleNodes=Fd(this),this.idToIndex=Md(this.visibleNodes)}update(t){this.props=t,this.root=zu(this),this.visibleNodes=Fd(this),this.idToIndex=Md(this.visibleNodes),this.rowOffsets=null;const r=this.list.current;r&&"resetAfterIndex"in r&&r.resetAfterIndex(0,!1)}dispatch(t){return this.store.dispatch(t)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var t;return(t=this.props.width)!==null&&t!==void 0?t:300}get height(){var t;return(t=this.props.height)!==null&&t!==void 0?t:500}get indent(){var t;return(t=this.props.indent)!==null&&t!==void 0?t:24}get rowHeight(){return typeof this.props.rowHeight=="number"?this.props.rowHeight:24}getRowOffsets(){if(this.rowOffsets)return this.rowOffsets;const t=[0];for(let r=0;r<this.visibleNodes.length;r++)t.push(t[r]+this.rowHeightAt(r));return this.rowOffsets=t,t}get overscanCount(){var t;return(t=this.props.overscanCount)!==null&&t!==void 0?t:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var t;const r=(t=this.props.searchMatch)!==null&&t!==void 0?t:((n,s)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(s.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(t){var r;const n=this.props.childrenAccessor||"children";return(r=Hs(t,n))!==null&&r!==void 0?r:null}accessId(t){const r=this.props.idAccessor||"id",n=Hs(t,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}identify(t){if(typeof t=="string")return t;if(t instanceof lo)return t.id;const r=this.props.idAccessor||"id";return Hs(t,r)}identifyNull(t){return t==null?null:this.identify(t)}get firstNode(){var t;return(t=this.visibleNodes[0])!==null&&t!==void 0?t:null}get lastNode(){var t;return(t=this.visibleNodes[this.visibleNodes.length-1])!==null&&t!==void 0?t:null}get focusedNode(){var t;return(t=this.get(this.state.nodes.focus.id))!==null&&t!==void 0?t:null}get mostRecentNode(){var t;return(t=this.get(this.state.nodes.selection.mostRecent))!==null&&t!==void 0?t:null}get nextNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t+1)}get prevNode(){const t=this.indexOf(this.focusedNode);return t===null?null:this.at(t-1)}get(t){return t&&t in this.idToIndex&&this.visibleNodes[this.idToIndex[t]]||null}at(t){return this.visibleNodes[t]||null}nodesBetween(t,r){var n;if(t===null||r===null)return[];const s=(n=this.indexOf(t))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(s,o),i=Math.max(s,o);return this.visibleNodes.slice(a,i+1)}indexOf(t){const r=this.identifyNull(t);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return Ni(this,arguments,void 0,function*(t={}){var r,n;const s=t.parentId===void 0?Jp(this):t.parentId,o=(r=t.index)!==null&&r!==void 0?r:Xp(this),a=(n=t.type)!==null&&n!==void 0?n:"leaf",i=yield Nt(this.props.onCreate,{type:a,parentId:s,index:o,parentNode:this.get(s)});i&&(this.focus(i),setTimeout(()=>{this.edit(i).then(()=>{this.select(i),this.activate(i)})}))})}delete(t){return Ni(this,void 0,void 0,function*(){if(!t)return;const n=(Array.isArray(t)?t:[t]).map(a=>this.identify(a)),s=n.map(a=>this.get(a)).filter(a=>!!a),o=s.length?Math.min(...s.map(a=>{var i;return(i=a.rowIndex)!==null&&i!==void 0?i:0})):0;yield Nt(this.props.onDelete,{nodes:s,ids:n}),this.redrawList(o)})}edit(t){var r,n;const s=this.identify(t);return this.resolveEdit({cancelled:!0}),this.scrollTo(s),this.dispatch(Si(s)),this.redrawList((n=(r=this.get(s))===null||r===void 0?void 0:r.rowIndex)!==null&&n!==void 0?n:0),new Promise(o=>{Ks.editPromise=o})}submit(t,r){return Ni(this,void 0,void 0,function*(){var n,s;if(!t)return;const o=this.identify(t);yield Nt(this.props.onRename,{id:o,name:r,node:this.get(o)}),this.dispatch(Si(null)),this.resolveEdit({cancelled:!1,value:r}),this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Si(null)),this.resolveEdit({cancelled:!0}),this.redrawList(),setTimeout(()=>this.onFocus())}activate(t){const r=this.get(this.identifyNull(t));r&&Nt(this.props.onActivate,r)}resolveEdit(t){const r=Ks.editPromise;r&&r(t),Ks.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let t=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&t.push(n)}return t}focus(t,r={}){t&&(this.props.selectionFollowsFocus?this.select(t):(this.dispatch(zn(this.identify(t))),r.scroll!==!1&&this.scrollTo(t),this.focusedNode&&Nt(this.props.onFocus,this.focusedNode)))}pageUp(){var t,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var t,r;const n=this.visibleStartIndex,s=this.visibleStopIndex,o=s-n;let a=(r=(t=this.focusedNode)===null||t===void 0?void 0:t.rowIndex)!==null&&r!==void 0?r:0;a<s?a=s:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(t,r={}){var n;if(!t)return;const s=r.focus!==!1,o=this.identify(t);s&&this.dispatch(zn(o)),!((n=this.get(o))===null||n===void 0)&&n.isSelectable&&this.setSelection({ids:[o],anchor:o,mostRecent:o}),this.scrollTo(o,r.align),this.focusedNode&&s&&Nt(this.props.onFocus,this.focusedNode)}deselect(t){if(!t)return;const r=this.identify(t);this.dispatch(rn.remove(r)),Nt(this.props.onSelect,this.selectedNodes)}selectMulti(t,r={}){const n=this.get(this.identifyNull(t));if(!n)return;const s=r.focus!==!1;s&&this.dispatch(zn(n.id)),n.isSelectable&&(this.dispatch(rn.add(n.id)),this.dispatch(rn.anchor(n.id)),this.dispatch(rn.mostRecent(n.id))),this.scrollTo(n,r.align),this.focusedNode&&s&&Nt(this.props.onFocus,this.focusedNode),Nt(this.props.onSelect,this.selectedNodes)}selectContiguous(t){var r;if(!t)return;const n=this.identify(t);if(this.dispatch(zn(n)),!((r=this.get(n))===null||r===void 0)&&r.isSelectable){const{anchor:s,mostRecent:o}=this.state.nodes.selection,a=this.filterSelectableNodes(this.nodesBetween(s,this.identifyNull(n)));this.dispatch(rn.remove(this.nodesBetween(s,o))),this.dispatch(rn.add(a)),this.dispatch(rn.mostRecent(n))}this.scrollTo(n),this.focusedNode&&Nt(this.props.onFocus,this.focusedNode),Nt(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null})}selectAll(){var t,r,n;const s=this.filterSelectableNodes(Object.keys(this.idToIndex));this.setSelection({ids:s,anchor:(t=s[0])!==null&&t!==void 0?t:null,mostRecent:(r=s[s.length-1])!==null&&r!==void 0?r:null}),this.dispatch(zn((n=this.lastNode)===null||n===void 0?void 0:n.id)),this.focusedNode&&Nt(this.props.onFocus,this.focusedNode)}filterSelectableNodes(t){return t.map(r=>this.get(this.identify(r))).filter(r=>!!r&&r.isSelectable)}setSelection(t){var r;const n=new Set((r=t.ids)===null||r===void 0?void 0:r.map(a=>this.identify(a))),s=this.identifyNull(t.anchor),o=this.identifyNull(t.mostRecent);this.dispatch(rn.set({ids:n,anchor:s,mostRecent:o})),Nt(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:t}=this.state.dnd;switch(t.type){case"highlight":return t.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(t=>this.get(t)).filter(t=>!!t)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var t;if(this.isFiltered)return!1;const r=(t=this.get(this.state.dnd.parentId))!==null&&t!==void 0?t:this.root,n=this.dragNodes,s=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&Qp(r,o))return!1;return typeof s=="function"?!s({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof s=="string"?!r.data[s]:typeof s=="boolean"?!s:!0}drop(){const{parentId:t,index:r,dragIds:n}=this.state.dnd;Nt(this.props.onMove,{dragIds:n,parentId:t===io?null:t,index:r===null?0:r,dragNodes:this.dragNodes,parentNode:this.get(t)}),this.open(t)}hideCursor(){this.dispatch(xs.cursor({type:"none"}))}showCursor(t){this.dispatch(xs.cursor(t))}open(t,r=!0){var n,s;const o=this.identifyNull(t);o&&(this.isOpen(o)||(this.dispatch(_l.open(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),Nt(this.props.onToggle,o)))}close(t,r=!0){var n,s;const o=this.identifyNull(t);o&&this.isOpen(o)&&(this.dispatch(_l.close(o,this.isFiltered)),r&&this.redrawList((s=(n=this.get(o))===null||n===void 0?void 0:n.rowIndex)!==null&&s!==void 0?s:0),Nt(this.props.onToggle,o))}toggle(t){const r=this.identifyNull(t);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(t){const r=this.identifyNull(t);if(!r)return;const n=mc(this.root,r);let s=n==null?void 0:n.parent;for(;s;)this.open(s.id,!1),s=s.parent;this.redrawList()}openSiblings(t){const r=t.parent;if(!r)this.toggle(t.id);else if(r.children){const n=t.isOpen;for(let s of r.children)s.isInternal&&(n?this.close(s.id,!1):this.open(s.id,!1));this.redrawList(),this.scrollTo(this.focusedNode)}}openAll(){_a(this.root,t=>{t.isInternal&&this.open(t.id,!1)}),this.redrawList()}closeAll(){_a(this.root,t=>{t.isInternal&&this.close(t.id,!1)}),this.redrawList()}scrollTo(t,r="smart"){if(!t)return;const n=this.identify(t);return this.openParents(n),Zp(()=>n in this.idToIndex).then(()=>{var s;const o=this.idToIndex[n];o!==void 0&&((s=this.list.current)===null||s===void 0||s.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var t;return!!(!((t=this.props.searchTerm)===null||t===void 0)&&t.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(t){return t?this.state.nodes.selection.ids.has(t):!1}isOpen(t){var r,n,s;if(!t)return!1;if(t===io)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[t])!==null&&n!==void 0?n:!0:(s=this.state.nodes.open.unfiltered[t])!==null&&s!==void 0?s:o}isEditable(t){return this.isActionPossible(t,this.props.disableEdit)}isDraggable(t){return this.isActionPossible(t,this.props.disableDrag)}isSelectable(t){return this.isActionPossible(t,this.props.disableSelect)}isActionPossible(t,r=()=>!1){return!Hs(t,r)}isDragging(t){const r=this.identifyNull(t);return r?this.state.nodes.drag.id===r:!1}isFocused(t){return this.hasFocus&&this.state.nodes.focus.id===t}isMatch(t){return this.matchFn(t)}willReceiveDrop(t){const r=this.identifyNull(t);if(!r)return!1;const{destinationParentId:n,destinationIndex:s}=this.state.nodes.drag;return r===n&&s===null}onFocus(){const t=this.focusedNode||this.firstNode;t&&this.dispatch(zn(t.id))}onBlur(){this.dispatch(VE())}onItemsRendered(t){this.visibleStartIndex=t.visibleStartIndex,this.visibleStopIndex=t.visibleStopIndex}get renderContainer(){return this.props.renderContainer||wm}get renderRow(){return this.props.renderRow||ME}get renderNode(){return this.props.children||BE}get renderDragPreview(){return this.props.renderDragPreview||em}get renderCursor(){return this.props.renderCursor||FE}}function Rt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mD=typeof Symbol=="function"&&Symbol.observable||"@@observable",Bd=mD,Ri=()=>Math.random().toString(36).substring(7).split("").join("."),gD={INIT:`@@redux/INIT${Ri()}`,REPLACE:`@@redux/REPLACE${Ri()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ri()}`},Bn=gD;function Em(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function vD(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(CD(e))return"date";if(bD(e))return"error";const r=yD(e);switch(r){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return r}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function yD(e){return typeof e.constructor=="function"?e.constructor.name:null}function bD(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function CD(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function on(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=vD(e)),t}function km(e,t,r){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?Rt(2):`Expected the root reducer to be a function. Instead, received: '${on(e)}'`);if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Rt(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?Rt(1):`Expected the enhancer to be a function. Instead, received: '${on(r)}'`);return r(km)(e,t)}let n=e,s=t,o=new Map,a=o,i=0,c=!1;function u(){a===o&&(a=new Map,o.forEach((v,y)=>{a.set(y,v)}))}function d(){if(c)throw new Error(process.env.NODE_ENV==="production"?Rt(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function f(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Rt(4):`Expected the listener to be a function. Instead, received: '${on(v)}'`);if(c)throw new Error(process.env.NODE_ENV==="production"?Rt(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;u();const C=i++;return a.set(C,v),function(){if(y){if(c)throw new Error(process.env.NODE_ENV==="production"?Rt(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,u(),a.delete(C),o=null}}}function m(v){if(!Em(v))throw new Error(process.env.NODE_ENV==="production"?Rt(7):`Actions must be plain objects. Instead, the actual type was: '${on(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?Rt(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?Rt(17):`Action "type" property must be a string. Instead, the actual type was: '${on(v.type)}'. Value was: '${v.type}' (stringified)`);if(c)throw new Error(process.env.NODE_ENV==="production"?Rt(9):"Reducers may not dispatch actions.");try{c=!0,s=n(s,v)}finally{c=!1}return(o=a).forEach(C=>{C()}),v}function h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Rt(10):`Expected the nextReducer to be a function. Instead, received: '${on(v)}`);n=v,m({type:Bn.REPLACE})}function b(){const v=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Rt(11):`Expected the observer to be an object. Instead, received: '${on(y)}'`);function C(){const x=y;x.next&&x.next(d())}return C(),{unsubscribe:v(C)}},[Bd](){return this}}}return m({type:Bn.INIT}),{dispatch:m,subscribe:f,getState:d,replaceReducer:h,[Bd]:b}}function qd(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function SD(e,t,r,n){const s=Object.keys(t),o=r&&r.type===Bn.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(s.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!Em(e))return`The ${o} has unexpected type of "${on(e)}". Expected argument to be an object with the following keys: "${s.join('", "')}"`;const a=Object.keys(e).filter(i=>!t.hasOwnProperty(i)&&!n[i]);if(a.forEach(i=>{n[i]=!0}),!(r&&r.type===Bn.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${s.join('", "')}". Unexpected keys will be ignored.`}function xD(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:Bn.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Rt(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof r(void 0,{type:Bn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Rt(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${Bn.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function $d(e){const t=Object.keys(e),r={};for(let a=0;a<t.length;a++){const i=t[a];process.env.NODE_ENV!=="production"&&typeof e[i]>"u"&&qd(`No reducer provided for key "${i}"`),typeof e[i]=="function"&&(r[i]=e[i])}const n=Object.keys(r);let s;process.env.NODE_ENV!=="production"&&(s={});let o;try{xD(r)}catch(a){o=a}return function(i={},c){if(o)throw o;if(process.env.NODE_ENV!=="production"){const f=SD(i,r,c,s);f&&qd(f)}let u=!1;const d={};for(let f=0;f<n.length;f++){const m=n[f],h=r[m],b=i[m],p=h(b,c);if(typeof p>"u"){const v=c&&c.type;throw new Error(process.env.NODE_ENV==="production"?Rt(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${m}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}d[m]=p,u=u||p!==b}return u=u||n.length!==Object.keys(i).length,u?d:i}}function _D(e=Ss().nodes.drag,t){switch(t.type){case"DND_DRAG_START":return Object.assign(Object.assign({},e),{id:t.id,selectedIds:t.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},e),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return t.parentId!==e.destinationParentId||t.index!=e.destinationIndex?Object.assign(Object.assign({},e),{destinationParentId:t.parentId,destinationIndex:t.index}):e;default:return e}}const wD=$d({nodes:$d({focus:HE,edit:UE,open:zE,selection:QE,drag:_D}),dnd:WE}),TD=Ss();function ED({treeProps:e,imperativeHandle:t,children:r}){const n=g.useRef(null),s=g.useRef(null),o=g.useRef(km(wD,Ss(e))),a=kE.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>TD),i=g.useMemo(()=>new Ks(o.current,e,n,s),[]),c=g.useRef(0);return g.useMemo(()=>{c.current+=1,i.update(e)},Object.values(e)),g.useMemo(()=>{c.current+=1,i.update(i.props)},[a.nodes.open]),g.useImperativeHandle(t,()=>i),g.useEffect(()=>{i.props.selection?i.select(i.props.selection,{focus:!1}):i.deselectAll()},[i.props.selection]),g.useEffect(()=>{i.props.searchTerm||o.current.dispatch(_l.clear(!0))},[i.props.searchTerm]),l.jsx(Mp.Provider,{value:i,children:l.jsx($p.Provider,{value:c.current,children:l.jsx(Bp.Provider,{value:a.nodes,children:l.jsx(qp.Provider,{value:a.dnd,children:l.jsx(rL,Object.assign({},e.dndManager?{manager:e.dndManager}:{backend:e.dndBackend||nD,options:{rootElement:i.props.dndRootElement||void 0}},{children:r}))})})})})}function kD(){const e=Xt(),[,t]=mm(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?e.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const s=n.getClientOffset();if(!e.listEl.current||!s)return;const{cursor:o,drop:a}=_m({element:e.listEl.current,offset:s,indent:e.indent,node:null,prevNode:e.visibleNodes[e.visibleNodes.length-1],nextNode:null});a&&e.dispatch(xs.hovering(a.parentId,a.index)),n.canDrop()?o&&e.showCursor(o):e.hideCursor()},drop:(r,n)=>{if(!n.isOver({shallow:!0})||!n.canDrop())return null;e.drop()}}),[e]);t(e.listEl)}function AD(e){return kD(),e.children}function LD(){const t=Xt().props.renderContainer||wm;return l.jsx(l.Fragment,{children:l.jsx(t,{})})}function ID(){const e=Xt(),{offset:t,mouse:r,item:n,isDragging:s}=AI(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=e.props.renderDragPreview||em;return l.jsx(o,{offset:t,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:s})}function DD(e={}){var t,r;const n=(t=e.idAccessor)!==null&&t!==void 0?t:"id",s=(r=e.childrenAccessor)!==null&&r!==void 0?r:"children";return{getId:typeof n=="function"?n:o=>o[n],getChildren:typeof s=="function"?s:o=>o[s],childrenKey:typeof s=="string"?s:"children"}}class jD{constructor(t,r={}){this.accessors=DD(r),this.root=OD(t,this.accessors)}get data(){var t,r;return(r=(t=this.root.children)===null||t===void 0?void 0:t.map(n=>n.data))!==null&&r!==void 0?r:[]}create(t){const r=t.parentId?this.find(t.parentId):this.root;if(!r)return null;r.addChild(t.data,t.index)}move(t){const r=this.find(t.id),n=t.parentId?this.find(t.parentId):this.root;!r||!n||(n.addChild(r.data,t.index),r.drop())}update(t){const r=this.find(t.id);r&&r.update(t.changes)}drop(t){const r=this.find(t.id);r&&r.drop()}find(t,r=this.root){if(!r)return null;if(r.id===t)return r;if(r.children){for(let n of r.children){const s=this.find(t,n);if(s)return s}return null}return null}}function OD(e,t){const r=new Am({},null,t,"ROOT");return r.children=e.map(n=>xc(n,r,t)),r}function xc(e,t,r){const n=new Am(e,t,r),s=r.getChildren(e);return s&&(n.children=s.map(o=>xc(o,n,r))),n}class Am{constructor(t,r,n,s){this.data=t,this.parent=r,this.accessors=n,this.id=s??n.getId(t)}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(t,r){var n,s;const o=xc(t,this,this.accessors);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o);const a=this.accessors.childrenKey,i=this.data;i[a]=(s=i[a])!==null&&s!==void 0?s:[],i[a].splice(r,0,t)}removeChild(t){var r,n;(r=this.children)===null||r===void 0||r.splice(t,1),(n=this.data[this.accessors.childrenKey])===null||n===void 0||n.splice(t,1)}update(t){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),t),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let ND=0;function RD(e,t={}){const[r,n]=g.useState(e),s=t.idAccessor,o=t.childrenAccessor,a=g.useMemo(()=>new jD(r,{idAccessor:s,childrenAccessor:o}),[r,s,o]),i=b=>{for(const p of b.dragIds)a.move({id:p,parentId:b.parentId,index:b.index});n(a.data)},c=({name:b,id:p})=>{a.update({id:p,changes:{name:b}}),n(a.data)},u=typeof s=="string"?s:"id",d=typeof o=="string"?o:"children";return[r,{onMove:i,onRename:c,onCreate:({parentId:b,index:p,type:v})=>{if(typeof s=="function")throw new Error("React Arborist => initialData can't create nodes when idAccessor is a function: the generated id can't be written under a key the accessor reads. Use a string idAccessor, or the controlled `data` prop with your own onCreate.");if(v==="internal"&&typeof o=="function")throw new Error("React Arborist => initialData can't create folder nodes when childrenAccessor is a function: the new children array can't be written under a key the accessor reads. Use a string childrenAccessor, or the controlled `data` prop with your own onCreate.");const y={[u]:`simple-tree-id-${ND++}`,name:""};return v==="internal"&&(y[d]=[]),a.create({parentId:b,index:p,data:y}),n(a.data),y},onDelete:b=>{b.ids.forEach(p=>a.drop({id:p})),n(a.data)}}]}function PD(e){if(e.initialData&&e.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(e.initialData&&(e.onCreate||e.onDelete||e.onMove||e.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
546
+ Use the data prop if you want to provide your own handlers.`);if(e.initialData){const[t,r]=RD(e.initialData,{idAccessor:e.idAccessor,childrenAccessor:e.childrenAccessor});return Object.assign(Object.assign(Object.assign({},e),r),{data:t})}else return e}function FD(e,t){const r=PD(e);return l.jsxs(ED,{treeProps:r,imperativeHandle:t,children:[l.jsx(AD,{children:l.jsx(LD,{})}),l.jsx(ID,{})]})}const MD=g.forwardRef(FD);function _c(){return ae(e=>{var n;const t=e.treeData[0];return(((n=t==null?void 0:t.metadata)==null?void 0:n.status)??(t==null?void 0:t.status)??"Draft").toLowerCase()==="draft"})}function BD(){return ae(e=>{var s;if(!e.selectedNodeId)return!1;const t=(s=e.treeData[0])==null?void 0:s.id,r=o=>{var a;for(const i of o){if(i.id===e.selectedNodeId)return i;if((a=i.children)!=null&&a.length){const c=r(i.children);if(c)return c}}},n=r(e.treeData);return!!(n!=null&&n.isFolder)&&n.id!==t})}const Ud={video:"#EA580C",pdf:"#DC2626",h5p:"#0D9488",scorm:"#7C3AED",audio:"#DB2777",quiz:"#16A34A",course:"#A85236",default:"#6B7280"},Vd={video:"Video",pdf:"FileText",h5p:"Layers",scorm:"Package",audio:"Music",quiz:"HelpCircle",course:"BookOpen",default:"File"},Hd=["Course Assessment","eTextbook","Exam Question","Explanation Content","Learning Resource","Practice Question Set","SCORM Content","Teacher Resource","Dynamic Course Assessment","Dynamic QuestionSet"],Pi=[{label:"All",value:"all"},{label:"Course Assessment",value:"Course Assessment"},{label:"eTextbook",value:"eTextbook"},{label:"Exam Question",value:"Exam Question"},{label:"Explanation Content",value:"Explanation Content"},{label:"Learning Resource",value:"Learning Resource"},{label:"Practice Question Set",value:"Practice Question Set"},{label:"SCORM Content",value:"SCORM Content"},{label:"Teacher Resource",value:"Teacher Resource"},{label:"Dynamic Course Assessment",value:"Dynamic Course Assessment"},{label:"Dynamic QuestionSet",value:"Dynamic QuestionSet"}];function qD(e){var r;if((r=e.metadata)!=null&&r.isAssessmentCourse)return"quiz";const t=[e.mimeType??"",e.primaryCategory??"",e.contentType??""].join(" ").toLowerCase();return t.includes("video")?"video":t.includes("pdf")||t.includes("epub")?"pdf":t.includes("h5p")?"h5p":t.includes("scorm")?"scorm":t.includes("audio")||t.includes("mp3")?"audio":t.includes("quiz")||t.includes("question")||t.includes("ecml")?"quiz":e.primaryCategory==="Course"?"course":"default"}function Ao(e){const t=qD(e);return{key:t,color:Ud[t]??Ud.default,bgClass:`sbx-ct-sq--${t}`,badgeClass:`sbx-ct-badge--${t}`,tintClass:`sbx-ct-tint--${t}`,iconName:Vd[t]??Vd.default,label:t.charAt(0).toUpperCase()+t.slice(1)}}const $D="_row_1yoqj_1",UD="_grip_1yoqj_16",VD="_menuBtn_1yoqj_19",HD="_rowLp_1yoqj_23",zD="_selected_1yoqj_27",QD="_title_1yoqj_32",WD="_dropTarget_1yoqj_41",GD="_toggle_1yoqj_58",KD="_ctIcon_1yoqj_73",YD="_ctIconLp_1yoqj_85",ZD="_folderIcon_1yoqj_89",XD="_rootIcon_1yoqj_94",JD="_titleLp_1yoqj_110",ej="_levelTitle_1yoqj_114",tj="_renameInput_1yoqj_119",rj="_dropHere_1yoqj_128",nj="_menuWrap_1yoqj_138",sj="_menu_1yoqj_19",oj="_dangerItem_1yoqj_190",ht={row:$D,grip:UD,menuBtn:VD,rowLp:HD,selected:zD,title:QD,dropTarget:WD,toggle:GD,ctIcon:KD,ctIconLp:YD,folderIcon:ZD,rootIcon:XD,titleLp:JD,levelTitle:ej,renameInput:tj,dropHere:rj,menuWrap:nj,menu:sj,dangerItem:oj},aj={video:Ha,pdf:So,h5p:$a,scorm:Va,audio:Ua,quiz:qa,course:Fr,default:Cn},ij=({node:e,style:t,dragHandle:r,editorMode:n})=>{var P;const[s,o]=g.useState(!1),[a,i]=g.useState(!1),[c,u]=g.useState(e.data.name),d=g.useRef(null),f=fe(),m=Z(O=>O.editorProfile),h=n==="edit",b=_c(),p=Ao(e.data),v=aj[p.key]??Cn,y=e.isSelected,C=e.level===0,S=e.data.isFolder??(e.children&&e.children.length>0),x=m.key==="learningPath",_=C?x?jp:Db:S?x?$b:Rh:v,w=x&&S&&!C&&!ot(e.data),E=x&&!!((P=e.data.metadata)!=null&&P.isAssessmentCourse),k=e.level+1<=m.maxDepth,N=x?f.learningPath.addLevelButton:f.treeNode.addSubunitMenuItem,F=x?f.learningPath.addLevelButton:f.treeNode.addSiblingMenuItem;g.useEffect(()=>{if(!s)return;const O=V=>{var ne;(ne=d.current)!=null&&ne.contains(V.target)||o(!1)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[s]);const I=g.useCallback(()=>{c.trim()&&e.submit(c.trim()),i(!1)},[c,e]),R=g.useCallback(O=>{O.key==="Enter"&&I(),O.key==="Escape"&&(u(e.data.name),i(!1))},[I,e.data.name]);return l.jsxs("div",{className:[ht.row,x?ht.rowLp:"",y?ht.selected:"",e.state.isOver&&S?ht.dropTarget:""].filter(Boolean).join(" "),style:t,onClick:()=>e.select(),"data-node-id":e.data.id,"data-droppable":S?"true":void 0,role:"treeitem","aria-selected":y,"aria-expanded":S?!e.isClosed:void 0,children:[h&&l.jsx("span",{ref:r,className:ht.grip,"aria-hidden":"true",children:l.jsx(Xl,{size:14})}),l.jsx("button",{className:ht.toggle,onClick:O=>{O.stopPropagation(),e.toggle()},"aria-label":e.isClosed?f.treeNode.expandAriaLabel:f.treeNode.collapseAriaLabel,style:{visibility:S?"visible":"hidden"},children:e.isClosed?l.jsx(Ba,{size:14}):l.jsx(bn,{size:14})}),l.jsx("span",{className:[ht.ctIcon,C||S||E?ht.folderIcon:p.bgClass,x?ht.ctIconLp:"",C&&x?ht.rootIcon:""].filter(Boolean).join(" "),"aria-hidden":"true",children:l.jsx(_,{size:C&&x?15:12})}),a?l.jsx("input",{className:ht.renameInput,value:c,autoFocus:!0,onChange:O=>u(O.target.value),onBlur:I,onKeyDown:R,onClick:O=>O.stopPropagation()}):l.jsx("span",{className:[ht.title,x?ht.titleLp:"",w?ht.levelTitle:""].filter(Boolean).join(" "),title:e.data.name,onDoubleClick:()=>h&&i(!0),children:e.data.name.length>25?`${e.data.name.slice(0,25)}...`:e.data.name}),e.state.isOver&&S&&l.jsx("span",{className:ht.dropHere,"aria-hidden":"true",children:f.treeNode.dropHereLabel}),h&&l.jsxs("div",{className:ht.menuWrap,ref:d,children:[l.jsx("button",{className:ht.menuBtn,onClick:O=>{O.stopPropagation(),o(V=>!V)},"aria-label":f.treeNode.nodeOptionsAriaLabel,children:l.jsx(Oh,{size:14})}),s&&l.jsxs("div",{className:ht.menu,role:"menu",children:[l.jsxs("button",{role:"menuitem",onClick:()=>{i(!0),o(!1)},children:[l.jsx(zb,{size:13})," ",f.treeNode.renameMenuItem]}),S&&b&&k&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.id}),o(!1)},children:[l.jsx(Nh,{size:13})," ",N]}),e.data.parent&&b&&!x&&l.jsxs("button",{role:"menuitem",onClick:()=>{e.tree.create({parentId:e.data.parent}),o(!1)},children:[l.jsx(Gr,{size:13})," ",F]}),!C&&l.jsxs("button",{role:"menuitem",className:ht.dangerItem,onClick:()=>{e.tree.delete(e.id),o(!1)},children:[l.jsx(ks,{size:13})," ",f.treeNode.deleteMenuItem]})]})]})]})};async function lj(e,t){var o,a;const n=((o=(await Ue.post(`/action/content/v3/upload/url/${e}?type=hierarchy`,{request:{content:{fileName:t}}})).data)==null?void 0:o.result)??{},s=((a=n.content)==null?void 0:a.preSignedURL)??n.pre_signed_url??n.preSignedUrl;if(!s)throw new Error("Could not obtain an upload URL");return s}async function cj(e,t){const r=await fetch(e,{method:"PUT",headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"text/csv"},body:t});if(!r.ok)throw new Error(`Blob upload failed (${r.status})`);return e.split("?")[0]}async function uj(e,t){var i;const r=await lj(e,t.name),n=await cj(r,t),s=new FormData;return s.append("fileUrl",n),s.append("mimeType",t.type||"text/csv"),{processId:(((i=(await Ue.post(`/action/collection/v1/import/${e}`,s)).data)==null?void 0:i.result)??{}).processId??""}}async function dj(e){var r;return((r=(await Ue.get(`/action/collection/v1/import/status/${e}`)).data)==null?void 0:r.result)??{status:"PENDING"}}async function Lm(e){var n,s,o;const r=(o=(s=(n=(await Ue.get(`/action/collection/v1/export/${e}`)).data)==null?void 0:n.result)==null?void 0:s.collection)==null?void 0:o.tocUrl;if(!r)throw new Error("No export URL returned");return r}async function fj(e){return Lm(e)}const hj="_container_jr3ij_1",pj="_header_jr3ij_13",mj="_title_jr3ij_22",gj="_closeBtn_jr3ij_29",vj="_body_jr3ij_45",yj="_dropZone_jr3ij_54",bj="_dragOver_jr3ij_67",Cj="_hasFile_jr3ij_72",Sj="_hiddenInput_jr3ij_78",xj="_fileInfo_jr3ij_82",_j="_fileIcon_jr3ij_89",wj="_fileName_jr3ij_93",Tj="_fileSize_jr3ij_100",Ej="_dropHint_jr3ij_105",kj="_dropIcon_jr3ij_112",Aj="_dropText_jr3ij_117",Lj="_dropSubtext_jr3ij_124",Ij="_sampleLink_jr3ij_130",Dj="_statusBar_jr3ij_145",jj="_status_uploading_jr3ij_154",Oj="_status_processing_jr3ij_154",Nj="_status_done_jr3ij_159",Rj="_status_error_jr3ij_164",Pj="_successDetail_jr3ij_170",Fj="_spinner_jr3ij_175",Mj="_spin_jr3ij_175",Bj="_errorMsg_jr3ij_191",qj="_failedSection_jr3ij_197",$j="_failedTitle_jr3ij_203",Uj="_tableWrap_jr3ij_213",Vj="_failedTable_jr3ij_219",Hj="_reasonCell_jr3ij_244",zj="_footer_jr3ij_248",Ge={container:hj,header:pj,title:mj,closeBtn:gj,body:vj,dropZone:yj,dragOver:bj,hasFile:Cj,hiddenInput:Sj,fileInfo:xj,fileIcon:_j,fileName:wj,fileSize:Tj,dropHint:Ej,dropIcon:kj,dropText:Aj,dropSubtext:Lj,sampleLink:Ij,statusBar:Dj,status_uploading:jj,status_processing:Oj,status_done:Nj,status_error:Rj,successDetail:Pj,spinner:Fj,spin:Mj,errorMsg:Bj,failedSection:qj,failedTitle:$j,tableWrap:Uj,failedTable:Vj,reasonCell:Hj,footer:zj},Qj=({contentId:e,onComplete:t,onClose:r,mode:n="create"})=>{const s=fe(),[o,a]=g.useState(null),[i,c]=g.useState(!1),[u,d]=g.useState("idle"),[f,m]=g.useState(""),[h,b]=g.useState([]),[p,v]=g.useState(null),y=g.useRef(null),C=g.useRef(null),S=g.useCallback(()=>{C.current!==null&&(clearInterval(C.current),C.current=null)},[]);g.useEffect(()=>()=>S(),[S]);const x=I=>I.name.toLowerCase().endsWith(".csv")?I.size>50*1024*1024?(m(s.csvUpload.fileTooLarge),!1):!0:(m(s.csvUpload.invalidFileType),!1),_=g.useCallback(I=>{m(""),b([]),v(null),d("idle"),x(I)&&a(I)},[]),w=g.useCallback(I=>{I.preventDefault(),c(!1);const R=I.dataTransfer.files[0];R&&_(R)},[_]),E=g.useCallback(I=>{var P;const R=(P=I.target.files)==null?void 0:P[0];R&&_(R),I.target.value=""},[_]),k=g.useCallback(async()=>{try{const I=await fj(e),R=document.createElement("a");R.href=I,R.download="sample_hierarchy.csv",R.target="_blank",R.click()}catch{m(s.csvUpload.downloadSampleFailed)}},[e,s.csvUpload.downloadSampleFailed]),N=g.useCallback(async()=>{if(o){d("uploading"),m(""),b([]);try{const{processId:I}=await uj(e,o);if(!I){d("done"),v(null),setTimeout(t,1500);return}d("processing"),C.current=setInterval(async()=>{try{const R=await dj(I);R.status==="COMPLETED"?(S(),d("done"),v(R.successCount??null),R.failedRecords&&R.failedRecords.length>0?b(R.failedRecords):setTimeout(t,1500)):R.status==="FAILED"&&(S(),d("error"),m(s.csvUpload.processingFailed),R.failedRecords&&b(R.failedRecords))}catch{S(),d("error"),m(s.csvUpload.connectionLost)}},2e3)}catch{d("error"),m(s.csvUpload.uploadFailed)}}},[e,o,t,S,s.csvUpload.processingFailed,s.csvUpload.connectionLost,s.csvUpload.uploadFailed]),F={idle:"",uploading:s.csvUpload.statusUploading,processing:s.csvUpload.statusProcessing,done:s.csvUpload.statusDone,error:s.csvUpload.statusError};return l.jsxs("div",{className:Ge.container,children:[l.jsxs("div",{className:Ge.header,children:[l.jsx("h2",{className:Ge.title,children:n==="update"?s.csvUpload.titleUpdate:s.csvUpload.titleCreate}),l.jsx("button",{className:Ge.closeBtn,onClick:r,"aria-label":s.csvUpload.closeAriaLabel,children:l.jsx(Mr,{size:18})})]}),l.jsxs("div",{className:Ge.body,children:[l.jsxs("div",{className:`${Ge.dropZone} ${i?Ge.dragOver:""} ${o?Ge.hasFile:""}`,onDragEnter:I=>{I.preventDefault(),c(!0)},onDragOver:I=>{I.preventDefault(),c(!0)},onDragLeave:I=>{I.preventDefault(),c(!1)},onDrop:w,onClick:()=>{var I;return(I=y.current)==null?void 0:I.click()},role:"button",tabIndex:0,"aria-label":s.csvUpload.dropZoneAriaLabel,onKeyDown:I=>{var R;return I.key==="Enter"&&((R=y.current)==null?void 0:R.click())},children:[l.jsx("input",{ref:y,type:"file",accept:".csv",className:Ge.hiddenInput,onChange:E,"aria-hidden":"true"}),o?l.jsxs("div",{className:Ge.fileInfo,children:[l.jsx(So,{size:24,className:Ge.fileIcon}),l.jsx("span",{className:Ge.fileName,children:o.name}),l.jsxs("span",{className:Ge.fileSize,children:["(",(o.size/1024).toFixed(1)," KB)"]})]}):l.jsxs("div",{className:Ge.dropHint,children:[l.jsx(dl,{size:32,className:Ge.dropIcon}),l.jsx("p",{className:Ge.dropText,children:s.csvUpload.dropText}),l.jsx("p",{className:Ge.dropSubtext,children:s.csvUpload.dropSubtext})]})]}),l.jsx("button",{className:Ge.sampleLink,onClick:k,type:"button",children:s.csvUpload.downloadSample}),u!=="idle"&&l.jsxs("div",{className:`${Ge.statusBar} ${Ge[`status_${u}`]}`,role:"status","aria-live":"polite",children:[u==="processing"&&l.jsx("span",{className:Ge.spinner,"aria-hidden":"true"}),F[u],u==="done"&&p!==null&&l.jsx("span",{className:Ge.successDetail,children:s.csvUpload.itemsImportedSuffix.replace("{count}",String(p))})]}),f&&l.jsx("p",{className:Ge.errorMsg,role:"alert",children:f}),h.length>0&&l.jsxs("div",{className:Ge.failedSection,children:[l.jsx("h4",{className:Ge.failedTitle,children:s.csvUpload.failedRowsTitle.replace("{count}",String(h.length))}),l.jsx("div",{className:Ge.tableWrap,children:l.jsxs("table",{className:Ge.failedTable,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:s.csvUpload.rowHeader}),l.jsx("th",{children:s.csvUpload.nameHeader}),l.jsx("th",{children:s.csvUpload.reasonHeader})]})}),l.jsx("tbody",{children:h.map((I,R)=>l.jsxs("tr",{children:[l.jsx("td",{children:I.rowNumber??R+1}),l.jsx("td",{children:I.name??"—"}),l.jsx("td",{className:Ge.reasonCell,children:I.reason??s.csvUpload.unknownError})]},R))})]})})]})]}),l.jsxs("div",{className:Ge.footer,children:[l.jsx(ze,{variant:"ghost",onClick:r,disabled:u==="uploading"||u==="processing",children:s.csvUpload.cancel}),l.jsx(ze,{variant:"primary",isLoading:u==="uploading"||u==="processing",disabled:!o||u==="done",onClick:N,children:u==="done"?s.csvUpload.uploaded:s.csvUpload.upload})]})]})};function wc(){var v,y,C,S,x,_,w;const e=fe(),t=ae(E=>E.treeData),r=ae(E=>E.treeCache),n=ae(E=>E.deleteNode),s=at(E=>E.activeAssessmentSlot),o=at(E=>E.setActiveAssessmentSlot),a=at(E=>E.openModal),i=((v=t[0])==null?void 0:v.children)??[],c=i[0],u=i.length>1?i[i.length-1]:void 0,d=ot(c),f=ot(u),m=t[0],h=m?((y=r[m.id])==null?void 0:y.policy)??((C=m.metadata)==null?void 0:C.policy):void 0,b=!!h&&kp.has(h),p=E=>{const k=E==="pre"?c:u;if(!k)return;const N=E==="pre"&&b?e.learningPath.deletePriorAssessmentConfirm:e.learningPath.deleteAssessmentSlotConfirm;a("confirmDelete",{message:N,onConfirm:()=>n(k.id)})};return{pre:{level:c,filled:d,courseName:d?(x=(S=c==null?void 0:c.children)==null?void 0:S[0])==null?void 0:x.name:void 0,required:b},post:{level:u,filled:f,courseName:f?(w=(_=u==null?void 0:u.children)==null?void 0:_[0])==null?void 0:w.name:void 0,required:!1},activeAssessmentSlot:s,setActiveAssessmentSlot:o,deleteSlot:p}}const Wj="_container_1ghxo_1",Gj="_header_1ghxo_8",Kj="_sectionLabel_1ghxo_18",Yj="_headerActions_1ghxo_26",Zj="_iconBtn_1ghxo_33",Xj="_menuWrap_1ghxo_51",Jj="_dropdownMenu_1ghxo_55",eO="_treeWrapper_1ghxo_87",tO="_csvModal_1ghxo_103",rO="_footer_1ghxo_113",Cr={container:Wj,header:Gj,sectionLabel:Kj,headerActions:Yj,iconBtn:Zj,menuWrap:Xj,dropdownMenu:Jj,treeWrapper:eO,csvModal:tO,footer:rO},nO=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{var Ne;const n=fe(),s=g.useRef(null),o=g.useRef(null),a=g.useRef(null),[i,c]=g.useState(400),[u,d]=g.useState(!1),[f,m]=g.useState(!1),[h,b]=g.useState("create"),{treeData:p,selectedNodeId:v,selectNode:y,addNode:C,deleteNode:S,getNodeById:x,reorderChildren:_,moveNode:w,setTreeData:E}=ae(),k=at(re=>re.openModal),N=Z(re=>re.editorProfile),F=N.key==="learningPath",I=e==="edit",R=_c(),P=I&&R,O=F?n.learningPath.addLevelButton:n.outlineTree.addUnitButton,V=N.maxDepth>1,ne=(((Ne=p[0])==null?void 0:Ne.children)??[]).some(re=>re.isFolder),{pre:W,post:ue,deleteSlot:ie}=wc(),{level:ve}=W,{level:me}=ue,H=Z(re=>{var ce,G,U,Ee;return((G=(ce=re.editorConfig)==null?void 0:ce.context)==null?void 0:G.contentId)??((Ee=(U=re.editorConfig)==null?void 0:U.context)==null?void 0:Ee.identifier)??""}),be=Z(re=>{var G,U;const ce=(U=(G=re.categoryMeta)==null?void 0:G.sourcingSettings)==null?void 0:U.collection;return(ce==null?void 0:ce.enableBulkUpload)!==!1}),Te=N.features.csvUpload&&be;g.useEffect(()=>{const re=o.current;if(!re)return;const ce=new ResizeObserver(()=>{c(re.clientHeight||400)});return ce.observe(re),c(re.clientHeight||400),()=>ce.disconnect()},[]),g.useEffect(()=>{if(!u)return;const re=ce=>{var G;(G=a.current)!=null&&G.contains(ce.target)||d(!1)};return document.addEventListener("mousedown",re),()=>document.removeEventListener("mousedown",re)},[u]);const $=g.useCallback(re=>{re.length>0&&y(re[0].data.id)},[y]),B=g.useCallback(({parentId:re,index:ce,dragIds:G})=>{if(!re)return;const U=G[0],Ee=jl(p,U);if(!Ee)return;const we=Ee.parent;if(we===re){const ke=jl(p,re);if(!(ke!=null&&ke.children))return;const xe=ke.children.findIndex(Pe=>Pe.id===U);if(xe<0)return;_(re,xe,ce>xe?ce-1:ce)}else w(U,we??"",re)},[p,_,w]),le=g.useCallback(({ids:re})=>{if(!F){for(const G of re)S(G);return}if(re.length===1){const G=re[0];if((ve==null?void 0:ve.id)===G){ie("pre");return}if((me==null?void 0:me.id)===G){ie("post");return}const U=x(G),Ee=U!=null&&U.isFolder?n.learningPath.deleteLevelConfirm.replace("{name}",U.name):n.learningPath.deleteCourseConfirm;k("confirmDelete",{message:Ee,onConfirm:()=>S(G)});return}const ce=n.learningPath.deleteMultipleConfirm.replace("{count}",String(re.length));k("confirmDelete",{message:ce,onConfirm:()=>{for(const G of re)S(G)}})},[S,ie,F,ve,me,x,k,n]),ge=g.useCallback(({parentId:re})=>{var U;const ce=re??((U=p[0])==null?void 0:U.id)??"";if(!ce)return{id:crypto.randomUUID()};const G=C(ce,"unit");return G?{id:G}:(Se.error(n.outlineTree.maxDepthReachedToast),{id:crypto.randomUUID()})},[C,p,n]),J=g.useCallback(()=>{var ce;const re=(ce=p[0])==null?void 0:ce.id;re&&(C(re,"unit")||Se.error(n.outlineTree.maxDepthReachedToast))},[p,C,n]),de=g.useCallback(()=>{v&&(C(v,"subunit")||Se.error(n.outlineTree.maxDepthReachedToast))},[v,C,n]),X=g.useCallback(async()=>{if(d(!1),!!H)try{const re=await Lm(H),ce=await fetch(re).then(Ee=>Ee.blob()),G=URL.createObjectURL(ce),U=document.createElement("a");U.href=G,U.download=`${H}-folders.csv`,U.style.display="none",document.body.appendChild(U),U.click(),document.body.removeChild(U),URL.revokeObjectURL(G)}catch{Se.error(n.outlineTree.downloadCsvFailedToast)}},[H,n]),Ce=g.useCallback(async()=>{if(m(!1),!!H)try{const{rootNode:re}=await pp(H);E([re]),Se.success(n.outlineTree.outlineRefreshedToast)}catch{Se.error(n.outlineTree.outlineRefreshFailedToast)}},[H,E,n]);return l.jsxs("div",{className:Cr.container,children:[l.jsxs("div",{className:Cr.header,children:[F&&l.jsx("span",{className:Cr.sectionLabel,children:n.learningPath.pathStructureLabel}),l.jsxs("div",{className:Cr.headerActions,children:[I&&Te&&l.jsxs("div",{className:Cr.menuWrap,ref:a,children:[l.jsx("button",{type:"button",className:Cr.iconBtn,onClick:()=>d(re=>!re),"aria-label":n.outlineTree.moreOptionsAriaLabel,title:n.outlineTree.moreOptionsTitle,"aria-haspopup":"true","aria-expanded":u,children:l.jsx(Oh,{size:15})}),u&&l.jsxs("div",{className:Cr.dropdownMenu,role:"menu",children:[l.jsx("button",{role:"menuitem",type:"button",disabled:ne,title:ne?n.outlineTree.foldersExistTitle:void 0,onClick:()=>{d(!1),b("create"),m(!0)},children:n.outlineTree.createFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:X,children:n.outlineTree.downloadFoldersCsvButton}),l.jsx("button",{role:"menuitem",type:"button",disabled:!ne,title:ne?void 0:n.outlineTree.noFoldersYetTitle,onClick:()=>{d(!1),b("update"),m(!0)},children:n.outlineTree.updateFoldersCsvButton})]})]}),r&&l.jsx("button",{type:"button",className:Cr.iconBtn,onClick:r,"aria-label":t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,title:t?n.outlineTree.expandOutlineAriaLabel:n.outlineTree.collapseOutlineAriaLabel,children:t?l.jsx(Vb,{size:15}):l.jsx(Ub,{size:15})})]})]}),l.jsx("div",{className:Cr.treeWrapper,ref:o,children:l.jsx(MD,{ref:s,data:p,idAccessor:"id",childrenAccessor:"children",onSelect:$,onMove:I?B:void 0,onDelete:I?le:void 0,onCreate:I?ge:void 0,disableEdit:!I,disableDrop:!I,selection:v??void 0,rowHeight:40,indent:20,paddingBottom:16,height:i,width:"100%",children:re=>l.jsx(ij,{...re,editorMode:e})})}),I&&l.jsxs("div",{className:Cr.footer,children:[l.jsxs(ze,{variant:"ghost",size:"sm",onClick:J,disabled:!P,children:[l.jsx(Gr,{size:14})," ",O]}),V&&l.jsxs(ze,{variant:"ghost",size:"sm",onClick:de,disabled:!P||!v,children:[l.jsx(Nh,{size:14})," ",n.outlineTree.addSubunitButton]})]}),f&&l.jsx("div",{className:Cr.csvModal,children:l.jsx(Qj,{contentId:H,mode:h,onComplete:Ce,onClose:()=>m(!1)})})]})};function jl(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=jl(r.children,t);if(n)return n}}}const sO="_breadcrumb_zd1aj_1",oO="_crumb_zd1aj_10",aO="_sep_zd1aj_26",iO="_current_zd1aj_31",Ms={breadcrumb:sO,crumb:oO,sep:aO,current:iO},lO=({crumbs:e})=>{const t=ae(n=>n.selectNode),r=fe();return e.length?l.jsxs("nav",{className:Ms.breadcrumb,"aria-label":r.breadcrumb.nodePathAriaLabel,children:[l.jsx("button",{className:Ms.crumb,onClick:()=>t(e[0].id),"aria-label":r.breadcrumb.homeAriaLabel,children:l.jsx(Bb,{size:13})}),e.map((n,s)=>l.jsxs(g.Fragment,{children:[l.jsx(Ba,{size:13,className:Ms.sep}),s<e.length-1?l.jsx("button",{className:Ms.crumb,onClick:()=>t(n.id),children:n.name}):l.jsx("span",{className:Ms.current,children:n.name})]},n.id))]}):null},cO="_tabBar_qhks1_1",uO="_tab_qhks1_1",dO="_active_qhks1_29",fO="_error_qhks1_35",hO="_errorDot_qhks1_39",Bs={tabBar:cO,tab:uO,active:dO,error:fO,errorDot:hO},pO=({activeTab:e,onChange:t,errorTabs:r=[],visibleTabs:n})=>{const s=fe(),o=[{id:"details",label:s.tabBar.detailsTab},{id:"audience",label:s.tabBar.audienceCurriculumTab},{id:"licensing",label:s.tabBar.licensingTab}],a=n?o.filter(i=>n.includes(i.id)):o;return l.jsx("div",{className:Bs.tabBar,role:"tablist","aria-label":s.tabBar.metadataSectionsAriaLabel,children:a.map(i=>l.jsxs("button",{role:"tab","aria-selected":e===i.id,"aria-controls":`panel-${i.id}`,className:[Bs.tab,e===i.id?Bs.active:"",r.includes(i.id)?Bs.error:""].join(" "),onClick:()=>t(i.id),children:[i.label,r.includes(i.id)&&l.jsx("span",{className:Bs.errorDot,"aria-label":s.tabBar.hasErrorsAriaLabel})]},i.id))})};var Lo=e=>e.type==="checkbox",kn=e=>e instanceof Date,Et=e=>e==null;const Im=e=>typeof e=="object";var rt=e=>!Et(e)&&!Array.isArray(e)&&Im(e)&&!kn(e),Ol=e=>rt(e)&&e.target?Lo(e.target)?e.target.checked:e.target.value:e,Dm=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),jm=e=>{const t=e.constructor&&e.constructor.prototype;return rt(t)&&t.hasOwnProperty("isPrototypeOf")},si=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function nt(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(si&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(rt(e)&&jm(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=nt(e[s]));return n}const ln={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},_r={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Fi="form",Om="root",Nm=["__proto__","constructor","prototype"];var Io=e=>/^\w*$/.test(e),Xe=e=>e===void 0,oi=e=>e.split(/[.[\]'"]/g).filter(Boolean),te=(e,t,r)=>{if(!t||!rt(e))return r;const n=Io(t)?[t]:oi(t);if(n.some(o=>Nm.includes(o)))return r;const s=n.reduce((o,a)=>Et(o)?void 0:o[a],e);return Xe(s)||s===e?Xe(e[t])?r:e[t]:s},or=e=>typeof e=="boolean",Ft=e=>typeof e=="function",Ke=(e,t,r)=>{let n=-1;const s=Io(t)?[t]:oi(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let c=r;if(n!==a){const u=e[i];c=rt(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(Nm.includes(i))return;e[i]=c,e=e[i]}};const Tc=g.createContext(null);Tc.displayName="HookFormControlContext";const Ec=()=>g.useContext(Tc);var Rm=(e,t,r,n=!0)=>{const s={};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==_r.all&&(t._proxyFormState[a]=!n||_r.all),r&&(r[a]=!0),e[a]}});return s};const kc=si?g.useLayoutEffect:g.useEffect;function mO(e){const t=Ec(),{control:r=t,disabled:n,name:s,exact:o}=e||{},[a,i]=g.useState(()=>({...r._formState,defaultValues:r._defaultValues})),c=g.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return kc(()=>r._subscribe({name:s,formState:c.current,exact:o,callback:u=>{!n&&i({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,o]),g.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),g.useMemo(()=>Rm(a,r,c.current,!1),[a,r])}var Mt=e=>typeof e=="string",Nl=(e,t,r,n,s)=>Mt(e)?(n&&t.watch.add(e),te(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),te(r,o))):(n&&(t.watchAll=!0),r),Rl=e=>Et(e)||!Im(e);const zd=(e,t)=>t.length===0&&!Array.isArray(e)&&!jm(e);function ar(e,t,r=new WeakMap){if(e===t)return!0;if(Rl(e)||Rl(t))return Object.is(e,t);if(kn(e)&&kn(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(zd(e,n)||zd(t,s))return Object.is(e,t);const o=r.get(e);if(o&&o.has(t))return!0;o?o.add(t):r.set(e,new WeakSet([t]));for(const a of n){const i=e[a];if(!(a in t))return!1;if(a!=="ref"){const c=t[a];if(kn(i)&&kn(c)||(rt(i)||Array.isArray(i))&&(rt(c)||Array.isArray(c))?!ar(i,c,r):!Object.is(i,c))return!1}}return!0}function gO(e){const t=Ec(),{control:r=t,name:n,defaultValue:s,disabled:o,exact:a,compute:i}=e||{},c=g.useRef(s),u=g.useRef(i),d=g.useRef(void 0),f=g.useRef(r),m=g.useRef(n);u.current=i;const[h,b]=g.useState(()=>{const x=r._getWatch(n,c.current);return u.current?u.current(x):x}),p=g.useCallback(x=>{const _=Nl(n,r._names,x||r._formValues,!1,c.current);return u.current?u.current(_):_},[r._formValues,r._names,n]),v=g.useCallback(x=>{if(!o){const _=Nl(n,r._names,x||r._formValues,!1,c.current);if(u.current){const w=u.current(_);ar(w,d.current)||(b(w),d.current=w)}else b(_)}},[r._formValues,r._names,o,n]);kc(()=>((f.current!==r||!ar(m.current,n))&&(f.current=r,m.current=n,v()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:x=>{v(x.values)}})),[r,a,n,v]),g.useEffect(()=>r._removeUnmounted());const y=f.current!==r,C=m.current,S=g.useMemo(()=>{if(o)return null;const x=!y&&!ar(C,n);return y||x?p():null},[o,y,n,C,p]);return S!==null?S:h}function Do(e){const t=Ec(),{name:r,disabled:n,control:s=t,shouldUnregister:o,defaultValue:a,exact:i=!0}=e,c=Dm(s._names.array,r),u=g.useMemo(()=>te(s._formValues,r,te(s._defaultValues,r,a)),[s,r,a]),d=gO({control:s,name:r,defaultValue:u,exact:i}),f=mO({control:s,name:r,exact:i}),m=g.useRef(e),h=g.useRef(null),b=g.useRef(s.register(r,{...e.rules,value:d,...or(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const p=g.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!te(f.errors,r)},isDirty:{enumerable:!0,get:()=>!!te(f.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!te(f.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!te(f.validatingFields,r)},error:{enumerable:!0,get:()=>te(f.errors,r)}}),[f,r]),v=g.useCallback(x=>{const _=Ol(x);return te(s._fields,r)||(b.current=s.register(r,{...m.current.rules,value:_})),b.current.onChange({target:{value:Ol(x),name:r},type:ln.CHANGE})},[r,s]),y=g.useCallback(()=>b.current.onBlur({target:{value:te(s._formValues,r),name:r},type:ln.BLUR}),[r,s._formValues]),C=g.useCallback(x=>{x&&(h.current={focus:()=>Ft(x.focus)&&x.focus(),select:()=>Ft(x.select)&&x.select(),setCustomValidity:w=>Ft(x.setCustomValidity)&&x.setCustomValidity(w),reportValidity:()=>Ft(x.reportValidity)&&x.reportValidity()});const _=te(s._fields,r);_&&_._f&&x&&(_._f.ref=h.current)},[s._fields,r]),S=g.useMemo(()=>({name:r,value:d,...or(n)||f.disabled?{disabled:f.disabled||n}:{},onChange:v,onBlur:y,ref:C}),[r,n,f.disabled,v,y,C,d]);return g.useEffect(()=>{const x=s._options.shouldUnregister||o;s.register(r,{...m.current.rules,...or(m.current.disabled)?{disabled:m.current.disabled}:{}});const _=(w,E)=>{const k=te(s._fields,w);k&&k._f&&(k._f.mount=E)};if(_(r,!0),x){const w=nt(te(o?s._defaultValues:s._options.values||s._defaultValues,r,te(s._options.defaultValues,r,m.current.defaultValue)));Ke(s._defaultValues,r,w),Xe(te(s._formValues,r))&&Ke(s._formValues,r,w)}if(!c&&s.register(r),h.current){const w=te(s._fields,r);w&&w._f&&(w._f.ref=h.current)}return()=>{(c?x&&!s._state.action:x)?s.unregister(r):_(r,!1)}},[r,s,c,o]),g.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),g.useMemo(()=>({field:S,formState:f,fieldState:p}),[S,f,p])}const vO=e=>e.render(Do(e)),Ac=g.createContext(null);Ac.displayName="HookFormContext";const vr=()=>g.useContext(Ac),yO=({children:e,watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:m,unregister:h,control:b,register:p,setFocus:v,subscribe:y})=>{const C=g.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:s,clearErrors:o,setValue:a,setValues:i,trigger:c,formState:u,resetField:d,reset:f,handleSubmit:m,unregister:h,control:b,register:p,setFocus:v,subscribe:y}),[o,b,u,n,r,m,p,f,d,s,v,a,i,y,c,h,t]);return g.createElement(Ac.Provider,{value:C},g.createElement(Tc.Provider,{value:C.control},e))};var bO=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},Pm=e=>Array.isArray(e)?e.filter(Boolean):[],la=e=>Array.isArray(e)?e:[e],Qd=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Fm(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&rt(s)&&o){const a=Fm(s,o);rt(a)&&(r[n]=a)}else e[n]&&(r[n]=o)}return r}var St=e=>rt(e)&&!Object.keys(e).length,Lc=e=>e.type==="file",Ta=e=>{if(!si)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Mm=e=>e.type==="select-multiple",Ic=e=>e.type==="radio",CO=e=>Ic(e)||Lo(e),Mi=e=>Ta(e)&&e.isConnected;function SO(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;){if(Et(e)){e=void 0;break}e=e[t[n]],n++}return e}function xO(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xe(e[t]))return!1;return!0}function ft(e,t){if(Mt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const r=Array.isArray(t)?t:Io(t)?[t]:oi(t),n=r.length===1?e:SO(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(rt(n)&&St(n)||Array.isArray(n)&&xO(n))&&ft(e,r.slice(0,-1)),e}var _O=e=>{for(const t in e)if(Ft(e[t]))return!0;return!1};function Bm(e){return Array.isArray(e)||rt(e)&&!_O(e)}function Pl(e,t={}){for(const r in e){const n=e[r];Bm(n)?(t[r]=Array.isArray(n)?[]:{},Pl(n,t[r])):Xe(n)||(t[r]=!0)}return t}function Fl(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>Fl(r));return t.some(r=>r!==void 0)?t:void 0}if(rt(e)){const t={};for(const r in e){const n=Fl(e[r]);Xe(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function _n(e,t,r){r||(r=Pl(t));for(const n in e){const s=e[n];if(Bm(s))Xe(t)||Rl(r[n])?r[n]=Pl(s,Array.isArray(s)?[]:{}):_n(s,Et(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ar(s,o)}}return Fl(r)||{}}const Wd={value:!1,isValid:!1},Gd={value:!0,isValid:!0};var qm=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Xe(e[0].attributes.value)?Xe(e[0].value)||e[0].value===""?Gd:{value:e[0].value,isValid:!0}:Gd:Wd}return Wd},$m=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Xe(e)?e:t?e===""?NaN:e&&+e:r&&Mt(e)?new Date(e):n?n(e):e;const Kd={isValid:!1,value:null};var Um=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Kd):Kd;function Yd(e){const t=e.ref;return Lc(t)?t.files:Ic(t)?Um(e.refs).value:Mm(t)?[...t.selectedOptions].map(({value:r})=>r):Lo(t)?qm(e.refs).value:$m(Xe(t.value)?e.ref.value:t.value,e)}var wO=(e,t,r,n)=>{const s={};for(const o of e){const a=te(t,o);a&&Ke(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},Ea=e=>e instanceof RegExp,qs=e=>Xe(e)?e:Ea(e)?e.source:rt(e)?Ea(e.value)?e.value.source:e.value:e,Zd=e=>({isOnSubmit:!e||e===_r.onSubmit,isOnBlur:e===_r.onBlur,isOnChange:e===_r.onChange,isOnAll:e===_r.all,isOnTouch:e===_r.onTouched});const Xd="AsyncFunction";var TO=e=>!!e&&!!e.validate&&!!(Ft(e.validate)&&e.validate.constructor.name===Xd||rt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Xd)),EO=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Bi=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const Ys=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=te(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Ys(i,t))break}else if(rt(i)&&Ys(i,t))break}}};function Jd(e,t,r){const n=te(e,r);if(n||Io(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=te(t,o),i=te(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var kO=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return St(o)||n&&Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||_r.all))},AO=(e,t,r)=>!e||!t||e===t||la(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),LO=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,IO=(e,t)=>!Pm(te(e,t)).length&&ft(e,t),ef=(e,t,r)=>{const n=te(e,r),s=Array.isArray(n)?n:[];return Ke(s,Om,t[r]),Ke(e,r,s),e};function tf(e,t,r="validate"){if(Mt(e)||Array.isArray(e)&&e.every(Mt)||or(e)&&!e)return{type:r,message:Mt(e)?e:"",ref:t}}var Zn=e=>rt(e)&&!Ea(e)?e:{value:e,message:""},rf=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:c,maxLength:u,minLength:d,min:f,max:m,pattern:h,validate:b,name:p,valueAsNumber:v,mount:y}=e._f,C=te(r,p);if(!y||t.has(p))return{};const S=i?i[0]:a,x=R=>{if(s&&S.reportValidity){const P=or(R)?"":R||"";i?i.forEach(O=>O.setCustomValidity(P)):S.setCustomValidity(P),S.reportValidity()}},_={},w=Ic(a),E=Lo(a),k=w||E,N=(v||Lc(a))&&Xe(a.value)&&Xe(C)||Ta(a)&&a.value===""||C===""||Array.isArray(C)&&!C.length,F=bO.bind(null,p,n,_),I=(R,P,O,V=Sr.maxLength,ne=Sr.minLength)=>{const W=R?P:O;_[p]={type:R?V:ne,message:W,ref:a,...F(R?V:ne,W)}};if(o?!Array.isArray(C)||!C.length:c&&(!k&&(N||Et(C))||or(C)&&!C||E&&!qm(i).isValid||w&&!Um(i).isValid)){const{value:R,message:P}=Mt(c)?{value:!!c,message:c}:Zn(c);if(R&&(_[p]={type:Sr.required,message:P,ref:S,...F(Sr.required,P)},!n))return x(P),_}if(!N&&(!Et(f)||!Et(m))){let R,P;const O=Zn(m),V=Zn(f);if(!Et(C)&&!isNaN(C)){const ne=a.valueAsNumber||C&&+C;Et(O.value)||(R=ne>O.value),Et(V.value)||(P=ne<V.value)}else{const ne=a.valueAsDate||new Date(C),W=ve=>new Date(new Date().toDateString()+" "+ve),ue=a.type=="time",ie=a.type=="week";Mt(O.value)&&C&&(R=ue?W(C)>W(O.value):ie?C>O.value:ne>new Date(O.value)),Mt(V.value)&&C&&(P=ue?W(C)<W(V.value):ie?C<V.value:ne<new Date(V.value))}if((R||P)&&(I(!!R,O.message,V.message,Sr.max,Sr.min),!n))return x(_[p].message),_}if((u||d)&&!N&&(Mt(C)||o&&Array.isArray(C))){const R=Zn(u),P=Zn(d),O=!Et(R.value)&&C.length>+R.value,V=!Et(P.value)&&C.length<+P.value;if((O||V)&&(I(O,R.message,P.message),!n))return x(_[p].message),_}if(h&&!N&&Mt(C)){const{value:R,message:P}=Zn(h);if(Ea(R)&&!C.match(R)&&(_[p]={type:Sr.pattern,message:P,ref:a,...F(Sr.pattern,P)},!n))return x(P),_}if(b){if(Ft(b)){const R=await b(C,r),P=tf(R,S);if(P&&(_[p]={...P,...F(Sr.validate,P.message)},!n))return x(P.message),_}else if(rt(b)){let R={};for(const P in b){if(!St(R)&&!n)break;const O=tf(await b[P](C,r),S,P);O&&(R={...O,...F(P,O.message)},x(O.message),n&&(_[p]=R))}if(!St(R)&&(_[p]={ref:S,...R},!n))return _}}return x(!0),_};const DO={mode:_r.onSubmit,reValidateMode:_r.onChange,shouldFocusError:!0},Vm={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function jO(e={}){let t={...DO,...e},r={...nt(Vm),isLoading:Ft(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},s=rt(t.defaultValues)||rt(t.values)?nt(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:nt(s),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={...d};let m={...f};const h={array:Qd(),state:Qd()},b=t.criteriaMode===_r.all,p=T=>D=>{clearTimeout(u),u=setTimeout(T,D)},v=async T=>{if(!a.keepIsValid&&!t.disabled&&(f.isValid||m.isValid||T)){let D;t.resolver?(D=St((await F()).errors),y()):D=await P({fields:n,onlyCheckValid:!0,eventType:ln.VALID}),D!==r.isValid&&h.state.next({isValid:D})}},y=(T,D)=>{!t.disabled&&(f.isValidating||f.validatingFields||m.isValidating||m.validatingFields)&&((T||Array.from(i.mount)).forEach(j=>{j&&(D?Ke(r.validatingFields,j,D):ft(r.validatingFields,j))}),h.state.next({validatingFields:r.validatingFields,isValidating:!St(r.validatingFields)}))},C=()=>{r.dirtyFields=_n(s,o)},S=(T,D=[],j,z,Q=!0,K=!0)=>{if(z&&j&&!t.disabled){if(a.action=!0,K&&Array.isArray(te(n,T))){const Y=j(te(n,T),z.argA,z.argB);Q&&Ke(n,T,Y)}if(K&&Array.isArray(te(r.errors,T))){const Y=j(te(r.errors,T),z.argA,z.argB);Q&&Ke(r.errors,T,Y),IO(r.errors,T)}if((f.touchedFields||m.touchedFields)&&K&&Array.isArray(te(r.touchedFields,T))){const Y=j(te(r.touchedFields,T),z.argA,z.argB);Q&&Ke(r.touchedFields,T,Y)}(f.dirtyFields||m.dirtyFields)&&C(),h.state.next({name:T,isDirty:V(T,D),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ke(o,T,D)},x=(T,D)=>{Ke(r.errors,T,D),r.errors={...r.errors},h.state.next({errors:r.errors})},_=T=>{r.errors=T,h.state.next({errors:r.errors,isValid:!1})},w=T=>{const D=Io(T)?[T]:oi(T);let j=o,z=s;for(let Q=0;Q<D.length-1;Q++){const K=D[Q];if(j=Et(j)?j:j[K],z=Et(z)?z:z[K],j===null&&z!==null)return!0}return!1},E=(T,D,j,z)=>{const Q=te(n,T);if(Q){if(w(T))return;const K=Xe(te(o,T)),Y=te(o,T,Xe(j)?te(s,T):j);Xe(Y)||z&&z.defaultChecked||D?Ke(o,T,D?Y:Yd(Q._f)):ue(T,Y),a.mount&&!a.action&&(v(),K&&r.isDirty&&(f.isDirty||m.isDirty)&&(V()||(r.isDirty=!1,h.state.next({...r}))),e.shouldUnregister&&K&&!Xe(te(o,T))&&Bi(T,i)&&(a.watch=!0))}},k=(T,D,j,z,Q)=>{let K=!1,Y=!1;const he={name:T};if(!t.disabled){if(!j||z){(f.isDirty||m.isDirty)&&(Y=r.isDirty,r.isDirty=he.isDirty=V(),K=Y!==he.isDirty);const De=ar(te(s,T),D);Y=!!te(r.dirtyFields,T),De!==r.isDirty?r.dirtyFields=_n(s,o):De?ft(r.dirtyFields,T):Ke(r.dirtyFields,T,!0),he.dirtyFields=r.dirtyFields,K=K||(f.dirtyFields||m.dirtyFields)&&Y!==!De}if(j){const De=te(r.touchedFields,T);De||(Ke(r.touchedFields,T,j),he.touchedFields=r.touchedFields,K=K||(f.touchedFields||m.touchedFields)&&De!==j)}K&&Q&&h.state.next(he)}return K?he:{}},N=(T,D,j,z)=>{const Q=te(r.errors,T),K=(f.isValid||m.isValid)&&or(D)&&r.isValid!==D;if(t.delayError&&j?(c=p(()=>x(T,j)),c(t.delayError)):(clearTimeout(u),c=null,j?Ke(r.errors,T,j):ft(r.errors,T),r.errors={...r.errors}),(j?!ar(Q,j):Q)||!St(z)||K){const Y={...z,...K&&or(D)?{isValid:D}:{},errors:r.errors,name:T};r={...r,...Y},h.state.next(Y)}},F=async T=>(y(T,!0),await t.resolver(o,t.context,wO(T||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),I=async T=>{const{errors:D}=await F(T);if(y(T),T){for(const j of T){const z=te(D,j);z?i.array.has(j)&&rt(z)&&!Object.keys(z).some(Q=>!Number.isNaN(Number(Q)))?ef(r.errors,{[j]:z},j):Ke(r.errors,j,z):ft(r.errors,j)}r.errors={...r.errors}}else r.errors=D;return D},R=async({name:T,eventType:D})=>{if(e.validate){const j=await e.validate({formValues:o,formState:r,name:T,eventType:D});if(rt(j))for(const z in j){const Q=j[z];Q&&J(`${Fi}.${z}`,{message:Mt(Q.message)?Q.message:"",type:Q.type||Sr.validate})}else Mt(j)||!j?J(Fi,{message:j||"",type:Sr.validate}):ge(Fi);return j}return!0},P=async({fields:T,onlyCheckValid:D,name:j,eventType:z,context:Q={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(Q.runRootValidation=!0,!await R({name:j,eventType:z})&&(Q.valid=!1,D)))return Q.valid;for(const K in T){const Y=T[K];if(Y){const{_f:he,...De}=Y;if(he){const Ze=i.array.has(he.name),It=Y._f&&TO(Y._f),gt=f.validatingFields||f.isValidating||m.validatingFields||m.isValidating;It&&gt&&y([he.name],!0);const lt=await rf(Y,i.disabled,o,b,t.shouldUseNativeValidation&&!D,Ze);if(It&&gt&&y([he.name]),lt[he.name]&&(Q.valid=!1,D)||(!D&&(te(lt,he.name)?Ze?ef(r.errors,lt,he.name):Ke(r.errors,he.name,lt[he.name]):ft(r.errors,he.name)),e.shouldUseNativeValidation&&lt[he.name]))break}!St(De)&&await P({context:Q,onlyCheckValid:D,fields:De,name:K,eventType:z})}}return Q.valid},O=()=>{for(const T of i.unMount){const D=te(n,T);D&&(D._f.refs?D._f.refs.every(j=>!Mi(j)):!Mi(D._f.ref))&&Ne(T)}i.unMount=new Set},V=(T,D)=>!t.disabled&&(T&&D&&Ke(o,T,D),!ar(B(),s)),ne=(T,D,j)=>Nl(T,i,{...a.mount?o:Xe(D)?s:Mt(T)?{[T]:D}:D},j,D),W=T=>Pm(te(a.mount?o:s,T,t.shouldUnregister?te(s,T,[]):[])),ue=(T,D,j={},z=!1)=>{const Q=te(n,T);let K=D;if(Q){const Y=Q._f;Y&&(!Y.disabled&&Ke(o,T,$m(D,Y)),K=Ta(Y.ref)&&Et(D)?"":D,Mm(Y.ref)?[...Y.ref.options].forEach(he=>he.selected=K.includes(he.value)):Y.refs?Lo(Y.ref)?Y.refs.forEach(he=>{(!he.defaultChecked||!he.disabled)&&(Array.isArray(K)?he.checked=!!K.find(De=>De===he.value):he.checked=K===he.value||!!K)}):Y.refs.forEach(he=>he.checked=he.value===K):Lc(Y.ref)?Y.ref.value="":(Y.ref.value=K,Y.ref.type||h.state.next({name:T,values:z?o:nt(o)})))}(j.shouldDirty||j.shouldTouch)&&k(T,K,j.shouldTouch,j.shouldDirty,!0),j.shouldValidate&&$(T)},ie=(T,D,j,z=!1)=>{for(const Q in D){if(!D.hasOwnProperty(Q))return;const K=D[Q],Y=T+"."+Q,he=te(n,Y);(i.array.has(T)||rt(K)||he&&!he._f)&&!kn(K)?ie(Y,K,j,z):ue(Y,K,j,z)}},ve=(T,D,j,z)=>{const Q=te(n,T),K=i.array.has(T),Y=z?D:nt(D),he=te(o,T),De=ar(he,Y);if(De||Ke(o,T,Y),K)h.array.next({name:T,values:z?o:nt(o)}),(f.isDirty||f.dirtyFields||m.isDirty||m.dirtyFields)&&j.shouldDirty&&(C(),h.state.next({name:T,dirtyFields:r.dirtyFields,isDirty:V(T,Y)}));else{const Ze=Array.isArray(Y)&&!Y.length||St(Y);!Q||Q._f||Et(Y)||Ze?ue(T,Y,j,z):ie(T,Y,j,z)}if(!De){const Ze=Bi(T,i),It=z?o:nt(o);h.state.next({...Ze&&r,name:a.mount||Ze?T:void 0,values:It})}},me=(T,D,j={})=>ve(T,D,j,!1),H=(T,D={})=>{const j=Ft(T)?T(o):T;if(!ar(o,j)){o={...o,...j};for(const z of i.mount)ve(z,te(j,z),D,!0);h.state.next({...r,name:void 0,type:void 0,values:o}),D.shouldValidate&&v()}},be=async T=>{a.mount=!0;const D=T.target;let j=D.name,z=!0;const Q=te(n,j),K=De=>{z=Number.isNaN(De)||kn(De)&&isNaN(De.getTime())||ar(De,te(o,j,De))},Y=Zd(t.mode),he=Zd(t.reValidateMode);if(Q){let De,Ze;const It=D.type?Yd(Q._f):Ol(T),gt=T.type===ln.BLUR||T.type===ln.FOCUS_OUT,lt=!EO(Q._f)&&!e.validate&&!t.resolver&&!te(r.errors,j)&&!Q._f.deps||LO(gt,te(r.touchedFields,j),r.isSubmitted,he,Y),Yr=Bi(j,i,gt);Ke(o,j,It),gt?(!D||!D.readOnly)&&(Q._f.onBlur&&Q._f.onBlur(T),c&&c(0)):Q._f.onChange&&Q._f.onChange(T);const Ar=k(j,It,gt),ct=!St(Ar)||Yr;if(!gt&&h.state.next({name:j,type:T.type,values:nt(o)}),lt)return(f.isValid||m.isValid)&&(t.mode==="onBlur"?gt&&v():gt||v()),ct&&h.state.next({name:j,...Yr?{}:Ar});if(!t.resolver&&e.validate&&await R({name:j,eventType:T.type}),!gt&&Yr&&h.state.next({...r}),t.resolver){const{errors:vt}=await F([j]);if(y([j]),K(It),!z){!St(Ar)&&h.state.next(Ar);return}const yt=Jd(r.errors,n,j),zt=Jd(vt,n,yt.name||j);De=zt.error,j=zt.name,Ze=St(vt)}else y([j],!0),De=(await rf(Q,i.disabled,o,b,t.shouldUseNativeValidation))[j],y([j]),K(It),z&&(De?Ze=!1:(f.isValid||m.isValid)&&(Ze=await P({fields:n,onlyCheckValid:!0,name:j,eventType:T.type})));z&&(Q._f.deps&&(!Array.isArray(Q._f.deps)||Q._f.deps.length>0)&&$(Q._f.deps),N(j,Ze,De,Ar))}},Te=(T,D)=>{if(te(r.errors,D)&&T.focus)return T.focus(),1},$=async(T,D={})=>{let j,z;const Q=la(T);if(t.resolver){const K=await I(Xe(T)?T:Q);j=St(K),z=T?!Q.some(Y=>te(K,Y)):j}else T?(z=(await Promise.all(Q.map(async K=>{const Y=te(n,K);return await P({fields:Y&&Y._f?{[K]:Y}:Y,eventType:ln.TRIGGER})}))).every(Boolean),!(!z&&!r.isValid)&&v()):z=j=await P({fields:n,name:T,eventType:ln.TRIGGER});return h.state.next({...!Mt(T)||(f.isValid||m.isValid)&&j!==r.isValid?{}:{name:T},...t.resolver||!T?{isValid:j}:{},errors:r.errors}),D.shouldFocus&&!z&&Ys(n,Te,T?Q:i.mount),z},B=(T,D)=>{let j={...a.mount?o:s};return D&&(j=Fm(D.dirtyFields?r.dirtyFields:r.touchedFields,j)),Xe(T)?j:Mt(T)?te(j,T):T.map(z=>te(j,z))},le=(T,D)=>({invalid:!!te((D||r).errors,T),isDirty:!!te((D||r).dirtyFields,T),error:te((D||r).errors,T),isValidating:!!te(r.validatingFields,T),isTouched:!!te((D||r).touchedFields,T)}),ge=T=>{const D=T?la(T):void 0;D==null||D.forEach(j=>ft(r.errors,j)),D?D.forEach(j=>{h.state.next({name:j,errors:r.errors})}):h.state.next({errors:{}})},J=(T,D,j)=>{const z=(te(n,T,{_f:{}})._f||{}).ref,Q=te(r.errors,T)||{},{ref:K,message:Y,type:he,...De}=Q;Ke(r.errors,T,{...De,...D,ref:z}),h.state.next({name:T,errors:r.errors,isValid:!1}),j&&j.shouldFocus&&z&&z.focus&&z.focus()},de=(T,D)=>Ft(T)?h.state.subscribe({next:j=>"values"in j&&T(j.values||ne(void 0,D),j)}):ne(T,D,!0),X=T=>h.state.subscribe({next:D=>{if(AO(T.name,D.name,T.exact)&&kO(D,T.formState||f,qt,T.reRenderRoot)){const j={...o};T.callback({values:j,...r,...D,defaultValues:s})}}}).unsubscribe,Ce=T=>(a.mount=!0,m={...m,...T.formState},X({...T,formState:{...d,...T.formState}})),Ne=(T,D={})=>{for(const j of T?la(T):i.mount)i.mount.delete(j),i.array.delete(j),D.keepValue||(ft(n,j),ft(o,j)),!D.keepError&&ft(r.errors,j),!D.keepDirty&&ft(r.dirtyFields,j),!D.keepTouched&&ft(r.touchedFields,j),!D.keepIsValidating&&ft(r.validatingFields,j),!t.shouldUnregister&&!D.keepDefaultValue&&ft(s,j);h.state.next({values:nt(o)}),h.state.next({...r,...D.keepDirty?{isDirty:V()}:{}}),!D.keepIsValid&&v()},re=({disabled:T,name:D})=>{if(or(T)&&a.mount||T||i.disabled.has(D)){const Q=i.disabled.has(D)!==!!T;T?i.disabled.add(D):i.disabled.delete(D),Q&&a.mount&&!a.action&&v()}},ce=(T,D={})=>{let j=te(n,T);const z=or(D.disabled)||or(t.disabled),Q=!i.registerName.has(T)&&j&&j._f&&!j._f.mount;return Ke(n,T,{...j||{},_f:{...j&&j._f?j._f:{ref:{name:T}},name:T,mount:!0,...D}}),i.mount.add(T),j&&!Q?re({disabled:or(D.disabled)?D.disabled:t.disabled,name:T}):E(T,!0,D.value),{...z?{disabled:D.disabled||t.disabled}:{},...t.progressive?{required:!!D.required,min:qs(D.min),max:qs(D.max),minLength:qs(D.minLength),maxLength:qs(D.maxLength),pattern:qs(D.pattern)}:{},name:T,onChange:be,onBlur:be,ref:K=>{if(K){i.registerName.add(T),ce(T,D),i.registerName.delete(T),j=te(n,T);const Y=Xe(K.value)&&K.querySelectorAll&&K.querySelectorAll("input,select,textarea")[0]||K,he=CO(Y),De=j._f.refs||[];if(he?De.find(Ze=>Ze===Y):Y===j._f.ref)return;Ke(n,T,{_f:{...j._f,...he?{refs:[...De.filter(Mi),Y,...Array.isArray(te(s,T))?[{}]:[]],ref:{type:Y.type,name:T}}:{ref:Y}}}),E(T,!1,void 0,Y)}else j=te(n,T,{}),j._f&&(j._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(Dm(i.array,T)&&a.action)&&i.unMount.add(T)}}},G=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Ys(n,Te,i.mount),U=T=>{or(T)&&(h.state.next({disabled:T}),Ys(n,(D,j)=>{const z=te(n,j);z&&(D.disabled=z._f.disabled||T,Array.isArray(z._f.refs)&&z._f.refs.forEach(Q=>{Q.disabled=z._f.disabled||T}))},0,!1))},Ee=(T,D)=>async j=>{let z;j&&(j.preventDefault&&j.preventDefault(),j.persist&&j.persist());let Q=nt(o);if(h.state.next({isSubmitting:!0}),t.resolver){const{errors:K,values:Y}=await F();y(),r.errors=K,Q=nt(Y)}else await P({fields:n,eventType:ln.SUBMIT});if(i.disabled.size)for(const K of i.disabled)ft(Q,K);if(ft(r.errors,Om),St(r.errors)){h.state.next({errors:{}});try{await T(Q,j)}catch(K){z=K}}else D&&await D({...r.errors},j),G(),setTimeout(G);if(h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:St(r.errors)&&!z,submitCount:r.submitCount+1,errors:r.errors}),z)throw z},we=(T,D={})=>{te(n,T)&&(Xe(D.defaultValue)?me(T,nt(te(s,T))):(me(T,D.defaultValue),Ke(s,T,nt(D.defaultValue))),D.keepTouched||ft(r.touchedFields,T),D.keepDirty||(ft(r.dirtyFields,T),r.isDirty=D.defaultValue?V(T,nt(te(s,T))):V()),D.keepError||(ft(r.errors,T),f.isValid&&v()),h.state.next({...r}))},ke=(T,D={})=>{const j=T?nt(T):s,z=nt(j),Q=St(T),K=z;if(D.keepDefaultValues||(s=j),!D.keepValues){if(D.keepDirtyValues){const Y=new Set([...i.mount,...Object.keys(_n(s,o))]);for(const he of Array.from(Y)){const De=te(r.dirtyFields,he),Ze=te(o,he),It=te(K,he);De&&!Xe(Ze)?Ke(K,he,Ze):!De&&!Xe(It)&&me(he,It)}}else{if(si&&Xe(T))for(const Y of i.mount){const he=te(n,Y);if(he&&he._f){const De=Array.isArray(he._f.refs)?he._f.refs[0]:he._f.ref;if(Ta(De)){const Ze=De.closest("form");if(Ze){Ze.reset();break}}}}if(D.keepFieldsRef)for(const Y of i.mount)me(Y,te(K,Y));else n={}}if(t.shouldUnregister){if(o=D.keepDefaultValues?nt(s):{},D.keepFieldsRef)for(const Y of i.mount)Ke(o,Y,te(K,Y))}else o=nt(K);h.array.next({values:{...K}}),h.state.next({values:{...K}})}i={mount:D.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!f.isValid||!!D.keepIsValid||!!D.keepDirtyValues||!t.shouldUnregister&&!St(K),a.watch=!!t.shouldUnregister,a.keepIsValid=!!D.keepIsValid,a.action=!1,D.keepErrors||(r.errors={}),h.state.next({submitCount:D.keepSubmitCount?r.submitCount:0,isDirty:Q?!1:D.keepDirty?r.isDirty:D.keepValues?V():!!(D.keepDefaultValues&&!ar(T,s)),isSubmitted:D.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Q?{}:D.keepDirtyValues?D.keepDefaultValues&&o?_n(s,o):r.dirtyFields:D.keepDefaultValues&&T?_n(s,T):D.keepDirty?r.dirtyFields:{},touchedFields:D.keepTouched?r.touchedFields:{},errors:D.keepErrors?r.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},xe=(T,D)=>ke(Ft(T)?T(o):T,{...t.resetOptions,...D}),Pe=(T,D={})=>{const j=te(n,T),z=j&&j._f;if(z){const Q=z.refs?z.refs[0]:z.ref;Q.focus&&setTimeout(()=>{Q.focus(),D.shouldSelect&&Ft(Q.select)&&Q.select()})}},qt=T=>{r={...r,...T}},Lt={control:{register:ce,unregister:Ne,getFieldState:le,handleSubmit:Ee,setError:J,_subscribe:X,_runSchema:F,_updateIsValidating:y,_focusError:G,_getWatch:ne,_getDirty:V,_setValid:v,_setFieldArray:S,_setDisabledField:re,_setErrors:_,_getFieldArray:W,_reset:ke,_resetDefaultValues:()=>Ft(t.defaultValues)&&t.defaultValues().then(T=>{xe(T,t.resetOptions),h.state.next({isLoading:!1})}),_removeUnmounted:O,_disableForm:U,_subjects:h,_proxyFormState:f,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(T){a=T},get _defaultValues(){return s},get _names(){return i},set _names(T){i=T},get _formState(){return r},get _options(){return t},set _options(T){t={...t,...T}}},subscribe:Ce,trigger:$,register:ce,handleSubmit:Ee,watch:de,setValue:me,setValues:H,getValues:B,reset:xe,resetField:we,resetDefaultValues:(T,D={})=>{if(s=nt(T),!D.keepDirty){const j=_n(s,o);r.dirtyFields=j,r.isDirty=!St(j)}D.keepIsValid||v(),h.state.next({...r,defaultValues:s})},clearErrors:ge,unregister:Ne,setError:J,setFocus:Pe,getFieldState:le};return{...Lt,formControl:Lt}}function OO(e={}){const t=g.useRef(void 0),r=g.useRef(void 0),n=g.useRef(e.formControl),[s,o]=g.useState(()=>({...nt(Vm),isLoading:Ft(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ft(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!Ft(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...c}=jO(e);t.current={...c,formState:s}}const a=t.current.control;return a._options=e,kc(()=>{const i=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return o(c=>({...c,isReady:!0})),a._formState.isReady=!0,i},[a]),g.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),g.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),g.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),g.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),g.useEffect(()=>{if(a._proxyFormState.isDirty){const i=a._getDirty();i!==s.isDirty&&a._subjects.state.next({isDirty:i})}},[a,s.isDirty]),g.useEffect(()=>{var i;e.values&&!ar(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((i=a._options.resetOptions)===null||i===void 0)&&i.keepIsValid||a._setValid(),r.current=e.values,o(c=>({...c}))):a._resetDefaultValues()},[a,e.values]),g.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=g.useMemo(()=>Rm(s,a),[a,s]),t.current}function NO(e,t,r){const n=e??[],s=new Set(n.map(d=>d.type).filter(Boolean)),o=(t??[]).filter(d=>!s.has(d)),{data:a}=zr({queryKey:["framework-search",o.sort().join(","),r],queryFn:()=>O0({type:o,systemDefault:"Yes"}),enabled:o.length>0,staleTime:600*1e3}),i=t&&t.length?n.filter(d=>d.type&&t.includes(d.type)):n,c=[...(a??[]).map(d=>({label:d.name,value:d.identifier})),...i.map(d=>({label:d.name,value:d.identifier}))],u=new Set;return c.filter(d=>u.has(d.value)?!1:(u.add(d.value),!0))}async function Hm(e){var r,n;return(n=(r=(await Ue.get(`/action/channel/v1/read/${e}`)).data)==null?void 0:r.result)==null?void 0:n.channel}function RO(e){var r,n,s,o,a,i,c;const t=zr({queryKey:["channel",e],queryFn:()=>Hm(e),enabled:!!e,staleTime:6e5});return{identifier:((r=t.data)==null?void 0:r.identifier)??e??"",name:(n=t.data)==null?void 0:n.name,frameworks:(s=t.data)==null?void 0:s.frameworks,collectionAdditionalCategories:(o=t.data)==null?void 0:o.collectionAdditionalCategories,contentAdditionalCategories:(a=t.data)==null?void 0:a.contentAdditionalCategories,defaultLicense:(i=t.data)==null?void 0:i.defaultLicense,defaultFramework:(c=t.data)==null?void 0:c.defaultFramework,isLoading:t.isLoading}}function PO(e){const{data:t}=zr({queryKey:["user","read",e],enabled:!!e,staleTime:1/0,queryFn:()=>g1(e)});return t&&([t.firstName,t.lastName].filter(Boolean).join(" ").trim()||t.userName)||void 0}const zm=[{label:"Strict",value:"strict"},{label:"Adaptive",value:"adaptive"},{label:"Prior learning",value:"priorLearning"}],FO={"First Section":{title:"Basic Information",description:"Core details that define the content identity."},"Second Section":{title:"Categorisation",description:"Category and type classification for the content."},"Third Section":{title:"Categorisation",description:"Category and type classification for the content."},"Organisation Framework Terms":{title:"Curriculum",description:"Framework-aligned categorisation."},"Target Framework Terms":{title:"Target Audience",description:"Curriculum alignment for the intended learners."},"Fourth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Sixth Section":{title:"Licensing & Attribution",description:"Copyright and usage rights information."},"Consumption policy":{title:"Consumption policy",description:"How learners move through this path."},Skills:{title:"Skills",description:"The skills learners gain from this course."},"Path skills":{title:"Skill framework and role",description:"The skill framework and, optionally, the role this path prepares learners for."}},Dc={skillFramework:"Skill framework",selectSkillFramework:"Select a skill framework",skills:"Skills",selectSkills:"Select skills",targetRole:"Target role (optional)",noTargetRole:"No target role"},MO=new Set(["review","read","sourcingreview","orgreview"]),Uo={"First Section":"details","Second Section":"details","Third Section":"details","Organisation Framework Terms":"details","Target Framework Terms":"audience","Fourth Section":"licensing","Sixth Section":"licensing"},BO={Categorisation:"Second Section","Basic Information":"First Section","Licensing & Attribution":"Fourth Section",Curriculum:"Organisation Framework Terms","Target Audience":"Target Framework Terms"},qO={name:"details",description:"details",keywords:"details",appIcon:"details",primaryCategory:"details",additionalCategories:"details",board:"details",boardIds:"details",subject:"details",subjectIds:"details",medium:"details",framework:"details",topicsIds:"details",topic:"details",dialcodeRequired:"details",dialcodes:"details",audience:"audience",targetBoardIds:"audience",targetMediumIds:"audience",targetGradeLevelIds:"audience",targetSubjectIds:"audience",gradeLevel:"audience",creator:"licensing",author:"licensing",attributions:"licensing",license:"licensing",copyright:"licensing",copyrightYear:"licensing"},Ds={board:"board",boardIds:"board",medium:"medium",gradeLevel:"gradeLevel",subject:"subject",subjectIds:"subject",topicsIds:"topic",topic:"topic",targetBoardIds:"board",targetMediumIds:"medium",targetGradeLevelIds:"gradeLevel",targetSubjectIds:"subject"},jc=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds"]),$O=new Set(Object.values(Ds));function Qm(e){var r;const t=pc((r=e.organisationFramework)==null?void 0:r.categories);return t&&!$O.has(t.code)?t:void 0}function Wm(e,t,r,n,s={}){if(!(e!=null&&e.length))return nf(lN(t,n,r,s),r,t,n,s);const o=new Map;for(const u of e){const d=u.code;d&&!o.has(d)&&o.set(d,u)}const a=Qm(r),i=new Set,c=e.filter(u=>{var f;if(n&&(u.code==="dialCode"||u.code==="dialcode")||((f=s.profile)==null?void 0:f.key)==="learningPath"&&jc.has(u.code)||u.visible===!1)return!1;const d=u.code;return i.has(d)?!1:(i.add(d),!0)}).map(u=>{const d=u.code??"",f=!!a&&d===a.code,m=f?"multiselect":YO(u),h=f?Oc(d,a.code,u,r,t,o,!0):ZO(u,r,t,o,s),b=t[d],p=f?Sn(b,a.terms):zO(d,Km(b,m),m,t,s),v={code:d,label:u.label??d,inputType:m,required:!!(u.required===!0||Array.isArray(u.validations)&&u.validations.some(y=>y.type==="required")),editable:ai(d,u.editable!==!1,s),placeholder:u.placeholder,maxLength:u.maxLength,options:GO(h,p,m,r),depends:u.depends,tab:KO(u),section:u.section,sourceCategory:u.sourceCategory??(f?d:void 0),defaultValue:u.defaultValue??u.default,currentValue:p,...f?{isSkillField:f}:{}};if(d==="dialcodes"){const y=t.dialcodeRequired==="Yes";return{...v,required:y,visible:y}}return v});return nf(c,r,t,n,s)}function nf(e,t,r,n,s){var a;if(((a=s.profile)==null?void 0:a.key)==="learningPath"){const i=iN(e,t,r,n);return n&&t.competency?VO(i,t.competency,r,s):i}const o=aN(e,t,r,n);return n&&t.competency?UO(o,t.competency,r,s):o}const sf="Skills",of="Path skills";function Gm(e,t,r,n){const s=r.competencyLabels??Dc,o=typeof t[ir]=="string"?t[ir]:"",a=o&&e.frameworks.some(i=>i.value===o)?o:"";return{selected:a,field:{code:ir,label:s.skillFramework,inputType:"select",editable:ai(ir,!0,r),tab:"details",section:n,placeholder:s.selectSkillFramework,options:e.frameworks,currentValue:a||void 0}}}function UO(e,t,r,n){if(t.frameworksLoaded&&t.frameworks.length===0)return e;const{field:s,selected:o}=Gm(t,r,n,sf),a=t.skillField,i=e.filter(f=>f.code!==ir&&(!o||!a||f.code!==a));if(!o||!a)return[...i,s];const c=n.competencyLabels??Dc,u=Sn(r[a],t.skills),d={code:a,label:c.skills,inputType:"multiselect",editable:ai(a,!0,n),tab:"details",section:sf,placeholder:c.selectSkills,options:HO(t.skills.map(f=>({label:f.name,value:f.code})),u),sourceCategory:a,isSkillField:!0,currentValue:u};return[...i,s,d]}function VO(e,t,r,n){if(t.frameworksLoaded&&t.frameworks.length===0)return e;const{field:s,selected:o}=Gm(t,r,n,of),a=e.filter(f=>f.code!==ir&&f.code!==wn).map(f=>o&&f.section===ca?{...f,required:!1}:f),i=t.roles??[];if(!o||i.length===0)return[...a,s];const c=n.competencyLabels??Dc,u=typeof r[wn]=="string"?r[wn]:"",d={code:wn,label:c.targetRole,inputType:"select",editable:ai(wn,!0,n),tab:"details",section:of,placeholder:c.noTargetRole,options:[{label:c.noTargetRole,value:""},...i],currentValue:u&&i.some(f=>f.value===u)?u:void 0};return[...a,s,d]}function HO(e,t){const r=new Set(e.map(n=>n.value));return[...e,...t.filter(n=>!r.has(n)).map(n=>({label:n,value:n}))]}function ai(e,t,r){var o;const n=r.editorMode??"edit";if(!MO.has(n))return t!==!1;const s=(o=r.editableFields)==null?void 0:o[n];return!!(s&&s.includes(e))}function zO(e,t,r,n,s){const o=t==null||t===""||Array.isArray(t)&&t.length===0;switch(e){case"license":return o?s.defaultLicense??"":t;case"copyright":return o&&s.channelName?s.channelName:t;case"copyrightYear":return o?String(new Date().getFullYear()):t;case"author":case"creator":return o&&s.userFullName?s.userFullName:t;case"instructions":{const a=n.instructions;return a&&typeof a=="object"&&!Array.isArray(a)?a.default??"":typeof t=="object"&&t!==null?"":t}case"maxTime":case"warningTime":{if(!o)return t;const a=n.timeLimits,i=a==null?void 0:a[e];return i!=null&&i!==""?QO(Number(i)):t}default:return t}}function QO(e){if(!Number.isFinite(e)||e<0)return"";const t=Math.floor(e%60),r=Math.floor(e/60%60),n=Math.floor(e/3600),s=o=>String(o).padStart(2,"0");return n>0?`${s(n)}:${s(r)}:${s(t)}`:`${s(r)}:${s(t)}`}function WO(e){var n,s,o;const t=new Map,r=a=>a==null?void 0:a.forEach(i=>{i.identifier&&t.set(i.identifier,i.name),i.name&&t.set(i.name,i.name)});return(s=(n=e.organisationFramework)==null?void 0:n.categories)==null||s.forEach(a=>r(a.terms)),(o=e.targetFrameworks)==null||o.forEach(a=>{var i;return(i=a.categories)==null?void 0:i.forEach(c=>r(c.terms))}),t}function GO(e,t,r,n){if(r!=="select"&&r!=="multiselect"&&r!=="radio")return e;const s=Array.isArray(t)?t:t!=null&&t!==""?[t]:[];if(!s.length)return e;const o=e?[...e]:[],a=new Set(o.map(c=>c.value)),i=WO(n);for(const c of s){const u=String(c);a.has(u)||(o.push({label:i.get(u)??u,value:u}),a.add(u))}return o}function KO(e){const t=e.section;if(t){if(Uo[t])return Uo[t];const n=BO[t];if(n&&Uo[n])return Uo[n]}const r=e.code??"";return qO[r]??"details"}function Km(e,t){const r=new Set(["multiselect","chips","keywords","tagsinput"]),n=new Set(["select","text","textarea","radio","datepicker","datetime","license"]);return r.has(t)?Array.isArray(e)?e:e!=null&&e!==""?[e]:[]:n.has(t)?Array.isArray(e)?e[0]??"":e??"":e}function YO(e){const t=(e.inputType??e.dataType??"").toLowerCase(),n=(e.dataType??"").toLowerCase()==="list";return t==="select"?"select":t==="framework"||t==="frameworkcategoryselect"?n?"multiselect":"select":t==="topicselector"?"chips":t==="multiselect"||t==="multi-select"?"multiselect":t==="keywords"||e.code==="keywords"||e.code==="topic"||e.code==="topicsIds"?"chips":t==="radio"?"radio":e.code==="appIcon"||t==="appicon"?"appIcon":t==="textarea"||e.code==="description"?"textarea":t==="datepicker"||t==="date"?"datepicker":t==="datetime"||t==="datetime-local"?"datetime":t==="tagsinput"?"tagsinput":t==="nestedselect"||t==="nested-select"?n?"multiselect":"select":t==="license"?"license":t==="dialcode"||t==="dial-code"?"dialcode":"text"}function ZO(e,t,r,n,s){var u;const o=e.code??"";if(((u=s.profile)==null?void 0:u.key)==="learningPath"&&o==="policy")return zm;if(o==="maxQuestions"){const d=s.childCount??0;if(d>0)return Array.from({length:d},(f,m)=>({label:String(m+1),value:String(m+1)}))}const a=e.range;if(Array.isArray(a)&&a.length)return typeof a[0]=="string"?a.map(d=>({label:d,value:d})):a.map(d=>({label:d.name,value:d.identifier}));const i=e.enum;if(i!=null&&i.length)return i.map(d=>({label:d,value:d}));if(o==="framework")return t.orgFrameworks;if(o==="additionalCategories"){const f=(s.objectType??"")==="QuestionSet"?s.contentAdditionalCategories??s.collectionAdditionalCategories:s.collectionAdditionalCategories??s.contentAdditionalCategories,m=(f&&f.length?f:s.contextAdditionalCategories)??t.channelAdditionalCategories;return m!=null&&m.length?tN(m).map(h=>({label:h,value:h})):void 0}const c=e.sourceCategory??Ds[o];if(c)return Oc(o,c,e,t,r,n)}function XO(e,t){return jc.has(e)||t.output==="identifier"||typeof t.section=="string"&&t.section.includes("Target")}function JO(e,t){return jc.has(e)||typeof t.section=="string"&&t.section.includes("Target")}function qi(e,t,r){var o,a,i,c,u;const n=(a=(o=e.organisationFramework)==null?void 0:o.categories)==null?void 0:a.find(d=>d.code===t),s=(u=(c=(i=e.targetFrameworks)==null?void 0:i[0])==null?void 0:c.categories)==null?void 0:u.find(d=>d.code===t);return r?(s==null?void 0:s.terms)??(n==null?void 0:n.terms)??[]:(n==null?void 0:n.terms)??(s==null?void 0:s.terms)??[]}function eN(e){const t=new Set,r=[];for(const n of e){const s=n.identifier??n.name;s&&!t.has(s)&&(t.add(s),r.push(n))}return r}function tN(e){return Array.from(new Set(e))}function rN(e){return Array.isArray(e)?e:e!=null&&e!==""?[e]:[]}function Oc(e,t,r,n,s,o,a=!1){const i=XO(e,r),c=JO(e,r),u=v=>({label:v.name,value:a?v.code:i?v.identifier:v.name}),d=r.depends;if(!(d!=null&&d.length))return qi(n,t,c).map(u);const f=d.flatMap(v=>rN(s[v])).map(String);if(!f.length)return[];const m=[];for(const v of d){const y=o.get(v),C=(y==null?void 0:y.sourceCategory)??Ds[v]??v;m.push(...qi(n,C,c))}const b=m.filter(v=>f.includes(String(v.name))||f.includes(String(v.identifier))||f.includes(String(v.code))).flatMap(v=>v.associations??[]).filter(v=>String(v.category??"").toLowerCase()===t.toLowerCase()),p=eN(b);return p.length?p.map(u):qi(n,t,c).map(u)}function $s(e,t){const r=Ds[e];if(r)return Oc(e,r,{},t,{},new Map)}function et(e,t,r){return Km(e[t],r)}const nN=["board","medium","gradeLevel","subject"];function sN(e){var r;const t=((r=e.organisationFramework)==null?void 0:r.categories)??[];return t.length?t.some(n=>nN.includes(n.code)):!0}function oN(e,t){var r,n,s;return!!((n=(r=e.organisationFramework)==null?void 0:r.categories)!=null&&n.some(o=>o.code===t)||(s=e.targetFrameworks)!=null&&s.some(o=>{var a;return(a=o.categories)==null?void 0:a.some(i=>i.code===t)}))}function aN(e,t,r,n){var u,d;if(!n||sN(t))return e;const s=e.filter(f=>{const m=f.sourceCategory??Ds[f.code];return!m||oN(t,m)}),o=new Set(s.map(f=>f.code)),a=(u=Qm(t))==null?void 0:u.code,i=[];for(const f of((d=t.organisationFramework)==null?void 0:d.categories)??[]){if(o.has(f.code))continue;const m=f.code===a;i.push({code:f.code,label:f.name,inputType:"multiselect",editable:!0,tab:"details",section:"Organisation Framework Terms",...m?{isSkillField:!0}:{},options:(f.terms??[]).map(h=>({label:h.name,value:m?h.code:h.name})),currentValue:m?Sn(r[f.code],f.terms):et(r,f.code,"multiselect")})}if(!i.length)return s;const c=s.findIndex(f=>f.code==="framework");return c>=0?[...s.slice(0,c+1),...i,...s.slice(c+1)]:[...s,...i]}const ca="Organisation Framework Terms";function iN(e,t,r,n){var h,b;if(!n)return e;const s=[...((h=t.organisationFramework)==null?void 0:h.categories)??[]].sort((p,v)=>(p.index??1/0)-(v.index??1/0));if(!s.length)return e;const o=(b=pc(s))==null?void 0:b.code,a=p=>p.sourceCategory??Ds[p.code];let c=e.filter(p=>{const v=a(p);return v?v!==o&&s.some(y=>y.code===v):!0}).map(p=>a(p)?{...p,section:ca,required:!0,inputType:"select",currentValue:et(r,p.code,"select")}:p),u=c.findIndex(p=>p.code==="framework");if(u===-1){const p={code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:ca,options:t.orgFrameworks,currentValue:et(r,"framework","select")},v=c.findIndex(y=>!!a(y));u=v>=0?v:c.length,c=[...c.slice(0,u),p,...c.slice(u)]}if(!!!et(r,"framework","select"))return c.filter(p=>p.code==="framework"||!a(p));const f=new Set(c.map(p=>p.code)),m=s.filter(p=>p.code!==o&&!f.has(p.code)).map(p=>({code:p.code,label:p.name,inputType:"select",required:!0,editable:!0,tab:"details",section:ca,options:(p.terms??[]).map(v=>({label:v.name,value:v.name})),currentValue:et(r,p.code,"select")}));return m.length?[...c.slice(0,u+1),...m,...c.slice(u+1)]:c}function lN(e,t,r,n={}){var o,a;const s=[{code:"name",label:"Title",inputType:"text",required:!0,editable:!0,tab:"details",section:"First Section",maxLength:200,currentValue:et(e,"name","text")},{code:"description",label:"Description",inputType:"textarea",editable:!0,tab:"details",section:"First Section",maxLength:2e3,currentValue:et(e,"description","textarea")},{code:"keywords",label:"Keywords",inputType:"chips",editable:!0,tab:"details",section:"First Section",currentValue:et(e,"keywords","chips")}];return t?((o=n.profile)==null?void 0:o.key)==="learningPath"?(s.push({code:"framework",label:"Curriculum",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:et(e,"framework","select")},{code:"policy",label:"Consumption policy",inputType:"select",required:!0,editable:!0,tab:"details",section:"Consumption policy",options:zm,currentValue:et(e,"policy","select")||"strict"}),s):(s.push({code:"primaryCategory",label:"Category",inputType:"select",editable:!1,tab:"details",section:"Second Section",currentValue:et(e,"primaryCategory","select")},{code:"additionalCategories",label:"Additional Category",inputType:"multiselect",editable:!0,tab:"details",section:"Second Section",currentValue:et(e,"additionalCategories","multiselect"),options:(a=r.channelAdditionalCategories)==null?void 0:a.map(i=>({label:i,value:i}))},{code:"framework",label:"Course Type",inputType:"select",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:r.orgFrameworks,currentValue:et(e,"framework","select")},{code:"subjectIds",label:"Subjects covered",inputType:"multiselect",required:!0,editable:!0,tab:"details",section:"Organisation Framework Terms",options:$s("subjectIds",r),currentValue:et(e,"subjectIds","multiselect")}),s.push({code:"audience",label:"Audience Type",inputType:"multiselect",editable:!0,tab:"audience",section:"Target Framework Terms",currentValue:et(e,"audience","multiselect")},{code:"targetBoardIds",label:"Board/Syllabus of the audience",inputType:"select",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",options:$s("targetBoardIds",r),currentValue:et(e,"targetBoardIds","select")},{code:"targetMediumIds",label:"Medium(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetBoardIds"],options:$s("targetMediumIds",r),currentValue:et(e,"targetMediumIds","multiselect")},{code:"targetGradeLevelIds",label:"Class(es) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetMediumIds"],options:$s("targetGradeLevelIds",r),currentValue:et(e,"targetGradeLevelIds","multiselect")},{code:"targetSubjectIds",label:"Subject(s) of the audience",inputType:"multiselect",required:!0,editable:!0,tab:"audience",section:"Target Framework Terms",depends:["targetGradeLevelIds"],options:$s("targetSubjectIds",r),currentValue:et(e,"targetSubjectIds","multiselect")}),s.push({code:"creator",label:"Author",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"creator","text")},{code:"attributions",label:"Attributions",inputType:"text",editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"attributions","text")},{code:"copyright",label:"Copyright",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"copyright","text")},{code:"copyrightYear",label:"Copyright Year",inputType:"text",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"copyrightYear","text")},{code:"license",label:"License",inputType:"select",required:!0,editable:!0,tab:"licensing",section:"Fourth Section",currentValue:et(e,"license","select")}),s):s}const cN=["allowECM","levels","setPeriod","instances"];function Ym(e){const t={};return e.forEach((r,n)=>{t[`L${n+1}`]={label:r}}),t}function uN(e,t={}){const r={...e};for(const o of cN)delete r[o];const n=e.levels;Array.isArray(n)&&n.length&&(r.outcomeDeclaration={levels:Ym(n)});const s=e.instances;return s!=null&&s!==""&&(r.instances={label:s}),t.isReview&&(r.name===void 0||r.name===null||r.name==="")&&t.nodeTitle&&(r.name=t.nodeTitle),r}function dN(e,t){return e==="allowECM"||e==="setPeriod"?null:e==="levels"?{outcomeDeclaration:{levels:Array.isArray(t)?Ym(t):{}}}:e==="instances"?{instances:t!=null&&t!==""?{label:t}:""}:{[e]:t}}function fN(e,t){const{watch:r,setValue:n}=e,s=g.useRef(!1);g.useEffect(()=>{const o=r((a,{name:i})=>{var c;if(!(!i||s.current)){s.current=!0;try{const u=new Set([i]);let d=!0;for(;d;){d=!1;for(const f of t)u.has(f.code)||(c=f.depends)!=null&&c.some(m=>u.has(m))&&(n(f.code,f.inputType==="multiselect"||f.inputType==="chips"?[]:"",{shouldDirty:!0}),u.add(f.code),d=!0)}}finally{s.current=!1}}});return()=>o.unsubscribe()},[r,n,t])}const hN="_section_ylgu8_1",pN="_header_ylgu8_11",mN="_title_ylgu8_17",gN="_description_ylgu8_24",vN="_divider_ylgu8_30",yN="_fields_ylgu8_36",Xn={section:hN,header:pN,title:mN,description:gN,divider:vN,fields:yN},bN=({title:e,description:t,children:r})=>l.jsxs("div",{className:Xn.section,children:[l.jsxs("div",{className:Xn.header,children:[l.jsx("h3",{className:Xn.title,children:e}),t&&l.jsx("p",{className:Xn.description,children:t})]}),l.jsx("hr",{className:Xn.divider}),l.jsx("div",{className:Xn.fields,children:r})]}),CN="_field_16hjq_1",SN="_fullWidth_16hjq_7",xN="_label_16hjq_11",_N="_required_16hjq_19",wN="_input_16hjq_24",TN="_textarea_16hjq_45",EN="_inputError_16hjq_50",kN="_error_16hjq_54",AN="_selectBtn_16hjq_59",LN="_selectOpen_16hjq_83",IN="_placeholder_16hjq_87",DN="_selectedVal_16hjq_91",jN="_chevronUp_16hjq_95",ON="_dropdown_16hjq_100",NN="_option_16hjq_116",RN="_optionSelected_16hjq_134",PN="_noOpts_16hjq_139",FN="_chipGroup_16hjq_146",MN="_chipInput_16hjq_158",BN="_addChipBtn_16hjq_167",qN="_radioGroup_16hjq_184",$N="_radioLabel_16hjq_191",UN="_iconWrap_16hjq_199",VN="_iconPreview_16hjq_214",HN="_iconPlaceholder_16hjq_220",zN="_removeIconBtn_16hjq_233",QN="_tagChip_16hjq_252",WN="_tagChipRemove_16hjq_264",GN="_nestedSelectRow_16hjq_278",KN="_dialcodeRow_16hjq_287",YN="_validateBtn_16hjq_293",ZN="_dialcodeValid_16hjq_315",XN="_dialcodeSpinner_16hjq_325",JN="_optionSearch_16hjq_329",M={field:CN,fullWidth:SN,label:xN,required:_N,input:wN,textarea:TN,inputError:EN,error:kN,selectBtn:AN,selectOpen:LN,placeholder:IN,selectedVal:DN,chevronUp:jN,dropdown:ON,option:NN,optionSelected:RN,noOpts:PN,chipGroup:FN,chipInput:MN,addChipBtn:BN,radioGroup:qN,radioLabel:$N,iconWrap:UN,iconPreview:VN,iconPlaceholder:HN,removeIconBtn:zN,tagChip:QN,tagChipRemove:WN,nestedSelectRow:GN,dialcodeRow:KN,validateBtn:YN,dialcodeValid:ZN,dialcodeSpinner:XN,optionSearch:JN},af=({name:e,label:t,required:r,disabled:n,multiline:s,maxLength:o,placeholder:a})=>{const i=fe(),{register:c,formState:{errors:u}}=vr(),d=u[e],f={required:r?i.textField.requiredError.replace("{field}",t):!1,maxLength:o?{value:o,message:i.textField.maxLengthError.replace("{max}",String(o))}:void 0};return l.jsxs("div",{className:[M.field,s?M.fullWidth:""].join(" "),children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),s?l.jsx("textarea",{id:e,className:[M.input,M.textarea,d?M.inputError:""].join(" "),disabled:n,placeholder:a,rows:3,...c(e,f)}):l.jsx("input",{id:e,type:"text",className:[M.input,d?M.inputError:""].join(" "),disabled:n,placeholder:a,...c(e,f)}),d&&l.jsx("span",{className:M.error,children:String(d.message)})]})},eR=7;function tR(e,t){const r=t.trim().toLowerCase();return r?e.filter(n=>n.label.toLowerCase().includes(r)):e}function Zm(e){const[t,r]=g.useState(""),n=g.useMemo(()=>tR(e,t),[e,t]);return{query:t,setQuery:r,filtered:n,searchable:e.length>=eR}}const Xm=({value:e,onChange:t,placeholder:r})=>l.jsxs("div",{className:M.optionSearch,children:[l.jsx(ya,{size:13,"aria-hidden":!0}),l.jsx("input",{type:"text",autoFocus:!0,value:e,placeholder:r,"aria-label":r,onChange:n=>t(n.target.value)})]}),rR=({name:e,label:t,options:r,required:n,disabled:s})=>{var x;const o=fe(),[a,i]=g.useState(!1),c=g.useRef(null),{query:u,setQuery:d,filtered:f,searchable:m}=Zm(r),{register:h,watch:b,setValue:p,formState:{errors:v}}=vr(),y=b(e),C=((x=r.find(_=>_.value===y))==null?void 0:x.label)??o.selectField.selectPlaceholder,S=v[e];return g.useEffect(()=>{if(!a){d("");return}const _=w=>{var E;(E=c.current)!=null&&E.contains(w.target)||i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[a]),l.jsxs("div",{className:M.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...h(e,{required:n?o.selectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[M.selectBtn,S?M.inputError:"",a?M.selectOpen:""].join(" "),onClick:()=>i(_=>!_),children:[l.jsx("span",{className:y?M.selectedVal:M.placeholder,children:C}),l.jsx(bn,{size:14,className:a?M.chevronUp:""})]}),a&&l.jsxs("div",{className:M.dropdown,children:[m&&l.jsx(Xm,{value:u,onChange:d,placeholder:o.selectField.searchPlaceholder}),f.map(_=>l.jsxs("button",{type:"button",className:[M.option,y===_.value?M.optionSelected:""].join(" "),onClick:()=>{p(e,_.value,{shouldDirty:!0,shouldValidate:!0}),i(!1)},children:[l.jsx("span",{children:_.label}),y===_.value&&l.jsx(Es,{size:13})]},_.value)),!r.length&&l.jsx("span",{className:M.noOpts,children:o.selectField.noOptionsMessage}),r.length>0&&!f.length&&l.jsx("span",{className:M.noOpts,children:o.selectField.noMatchesMessage})]}),S&&l.jsx("span",{className:M.error,children:String(S.message)})]})},nR=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=fe(),[a,i]=g.useState(!1),c=g.useRef(null),{query:u,setQuery:d,filtered:f,searchable:m}=Zm(r),{register:h,watch:b,setValue:p,formState:{errors:v}}=vr(),y=b(e)??[],C=v[e],S=y.length?`${y.length} ${o.multiSelectField.selectedCountSuffix}`:o.multiSelectField.selectPlaceholder;g.useEffect(()=>{if(!a){d("");return}const _=w=>{var E;(E=c.current)!=null&&E.contains(w.target)||i(!1)};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[a]);const x=_=>{const w=y.includes(_)?y.filter(E=>E!==_):[...y,_];p(e,w,{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:M.field,ref:c,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...h(e,{required:n?o.multiSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:s,className:[M.selectBtn,C?M.inputError:"",a?M.selectOpen:""].join(" "),onClick:()=>i(_=>!_),children:[l.jsx("span",{className:y.length?M.selectedVal:M.placeholder,children:S}),l.jsx(bn,{size:14,className:a?M.chevronUp:""})]}),a&&l.jsxs("div",{className:M.dropdown,children:[m&&l.jsx(Xm,{value:u,onChange:d,placeholder:o.multiSelectField.searchPlaceholder}),f.map(_=>l.jsxs("button",{type:"button",className:[M.option,y.includes(_.value)?M.optionSelected:""].join(" "),onClick:()=>x(_.value),children:[l.jsx(Es,{size:13,style:{opacity:y.includes(_.value)?1:0}}),l.jsx("span",{children:_.label})]},_.value)),!r.length&&l.jsx("span",{className:M.noOpts,children:o.multiSelectField.noOptionsMessage}),r.length>0&&!f.length&&l.jsx("span",{className:M.noOpts,children:o.multiSelectField.noMatchesMessage})]}),C&&l.jsx("span",{className:M.error,children:String(C.message)})]})},sR=({name:e,label:t,required:r,disabled:n,placeholder:s})=>{const o=fe(),a=s??o.chipGroupField.addPlaceholder,[i,c]=g.useState(""),[u,d]=g.useState(!1),f=g.useRef(null),{watch:m,setValue:h,formState:{errors:b}}=vr(),p=m(e)??[],v=b[e],y=()=>{const S=i.trim();S&&!p.includes(S)&&h(e,[...p,S],{shouldDirty:!0}),c(""),d(!1)},C=S=>h(e,p.filter(x=>x!==S),{shouldDirty:!0});return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:M.chipGroup,children:[p.map(S=>l.jsxs("span",{className:"sbx-chip filled",children:[S,!n&&l.jsx("button",{type:"button",className:"sbx-chip-remove",onClick:()=>C(S),"aria-label":`Remove ${S}`,children:"×"})]},S)),!n&&(u?l.jsx("input",{ref:f,autoFocus:!0,className:M.chipInput,value:i,onChange:S=>c(S.target.value),onKeyDown:S=>{S.key==="Enter"&&(S.preventDefault(),y()),S.key==="Escape"&&(c(""),d(!1))},onBlur:y,placeholder:a}):l.jsxs("button",{type:"button",className:M.addChipBtn,onClick:()=>{d(!0),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},50)},children:[l.jsx(Gr,{size:12})," ",o.chipGroupField.addButtonLabel]}))]}),v&&l.jsx("span",{className:M.error,children:String(v.message)})]})},oR=({name:e,label:t,options:r,required:n,disabled:s})=>{const o=fe(),{register:a,formState:{errors:i}}=vr(),c=i[e];return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("div",{className:M.radioGroup,children:r.map(u=>l.jsxs("label",{className:M.radioLabel,children:[l.jsx("input",{type:"radio",value:u.value,disabled:s,...a(e,{required:n?o.radioField.requiredError.replace("{field}",t):!1})}),u.label]},u.value))}),c&&l.jsx("span",{className:M.error,children:String(c.message)})]})};async function aR(e,t,r,n){var a,i;const o=(i=(a=(await Ue.post("/action/asset/v1/create",{request:{asset:{primaryCategory:"asset",language:["English"],code:crypto.randomUUID(),name:e,mediaType:"image",mimeType:t,createdBy:r,creator:null,channel:n,keywords:""}}})).data)==null?void 0:a.result)==null?void 0:i.node_id;if(!o)throw new Error("Asset creation failed: no node_id returned");return o}async function iR(e,t){var s,o;const n=(o=(s=(await Ue.post(`/action/content/v3/upload/url/${e}`,{request:{content:{fileName:t}}})).data)==null?void 0:s.result)==null?void 0:o.pre_signed_url;if(!n)throw new Error("Pre-signed URL fetch failed");return n}async function lR(e,t,r={}){const n=await fetch(e,{method:"PUT",body:t,headers:{"x-ms-blob-type":"BlockBlob","Content-Type":"application/octet-stream",...r}});if(!n.ok)throw new Error(`Blob upload failed: ${n.status} ${n.statusText}`)}async function cR(e,t,r){var a,i;const n=new FormData;n.append("fileUrl",t),n.append("mimeType",r);const o=(i=(a=(await Ue.post(`/action/asset/v1/upload/${e}`,n,{params:{enctype:"multipart/form-data",processData:!1,contentType:!1,cache:!1}})).data)==null?void 0:a.result)==null?void 0:i.content_url;if(!o)throw new Error("Asset finalize failed: no content_url returned");return o}const uR="_overlay_ga6eh_1",dR="_modal_ga6eh_12",fR="_header_ga6eh_24",hR="_title_ga6eh_33",pR="_closeBtn_ga6eh_39",mR="_tabs_ga6eh_57",gR="_tab_ga6eh_57",vR="_activeTab_ga6eh_83",yR="_body_ga6eh_88",bR="_searchWrap_ga6eh_99",CR="_searchIcon_ga6eh_104",SR="_searchInput_ga6eh_113",xR="_grid_ga6eh_132",_R="_imgCell_ga6eh_148",wR="_imgCellSelected_ga6eh_166",TR="_thumb_ga6eh_171",ER="_noThumb_ga6eh_177",kR="_checkBadge_ga6eh_183",AR="_loadMoreBtn_ga6eh_198",LR="_loadingRow_ga6eh_220",IR="_empty_ga6eh_230",DR="_spinner_ga6eh_237",jR="_uploadArea_ga6eh_247",OR="_dropZone_ga6eh_256",NR="_uploadIcon_ga6eh_277",RR="_dropText_ga6eh_281",PR="_dropSubtext_ga6eh_288",FR="_uploadPreview_ga6eh_294",MR="_hiddenInput_ga6eh_301",BR="_fileName_ga6eh_305",qR="_errorText_ga6eh_311",$R="_footer_ga6eh_318",UR="_cancelBtn_ga6eh_328",VR="_confirmBtn_ga6eh_345",je={overlay:uR,modal:dR,header:fR,title:hR,closeBtn:pR,tabs:mR,tab:gR,activeTab:vR,body:yR,searchWrap:bR,searchIcon:CR,searchInput:SR,grid:xR,imgCell:_R,imgCellSelected:wR,thumb:TR,noThumb:ER,checkBadge:kR,loadMoreBtn:AR,loadingRow:LR,empty:IR,spinner:DR,uploadArea:jR,dropZone:OR,uploadIcon:NR,dropText:RR,dropSubtext:PR,uploadPreview:FR,hiddenInput:MR,fileName:BR,errorText:qR,footer:$R,cancelBtn:UR,confirmBtn:VR},lf=18,Jm=({nodeId:e,currentValue:t,onSelect:r,onClose:n})=>{const s=fe(),[o,a]=g.useState("my"),[i,c]=g.useState(""),[u,d]=g.useState([]),[f,m]=g.useState(0),[h,b]=g.useState(!1),[p,v]=g.useState(null),[y,C]=g.useState(0),[S,x]=g.useState(null),[_,w]=g.useState(""),[E,k]=g.useState(!1),[N,F]=g.useState(""),I=g.useRef(null),R=Z($=>{var B,le;return((le=(B=$.editorConfig)==null?void 0:B.context)==null?void 0:le.channel)??""}),P=Z($=>{var B,le;return((le=(B=$.editorConfig)==null?void 0:B.context)==null?void 0:le.uid)??""}),O=Z($=>{var B,le,ge;return((ge=(le=(B=$.editorConfig)==null?void 0:B.context)==null?void 0:le.cloudStorage)==null?void 0:ge.presigned_headers)??{}}),V=Z($=>{var B,le,ge;return((ge=(le=(B=$.editorConfig)==null?void 0:B.config)==null?void 0:le.assetConfig)==null?void 0:ge.size)??1*1024*1024}),ne=Z($=>{var B,le,ge;return((ge=(le=(B=$.editorConfig)==null?void 0:B.config)==null?void 0:le.assetConfig)==null?void 0:ge.accepted)??"image/png,image/jpeg"}),W=g.useCallback(async($,B,le=!1)=>{var ge;b(!0);try{const J={status:["Live"],mediaType:["image"],mimeType:["image/png","image/jpeg","image/jpg","image/gif","image/svg+xml"]};o==="my"&&P&&(J.createdBy=P),R&&(J.channel=R);const X=((ge=(await Ue.post("/action/composite/v3/search",{request:{filters:J,query:$,limit:lf,offset:B,sort_by:{createdOn:"desc"},fields:["identifier","name","appIcon","artifactUrl","downloadUrl"]}},{headers:{"X-Source":"web"}})).data)==null?void 0:ge.result)??{},Ce=X.content??[];m(X.count??0),d(Ne=>le?[...Ne,...Ce]:Ce)}catch{}finally{b(!1)}},[o,P,R]);g.useEffect(()=>{o!=="upload"&&(d([]),C(0),W(i,0))},[o]);const ue=g.useRef(),ie=$=>{c($),clearTimeout(ue.current),ue.current=setTimeout(()=>{d([]),C(0),W($,0)},400)},ve=()=>{const $=y+lf;C($),W(i,$,!0)},me=()=>{const $=(p==null?void 0:p.artifactUrl)??(p==null?void 0:p.appIcon)??(p==null?void 0:p.downloadUrl)??"";$&&r($)};g.useEffect(()=>()=>{_&&URL.revokeObjectURL(_)},[_]);const H=$=>{var ge;const B=(ge=$.target.files)==null?void 0:ge[0];if($.target.value="",!B)return;const le=ne.split(",").map(J=>J.trim());if(!le.includes(B.type)){const J=le.map(de=>de.replace("image/","").toUpperCase()).join(", ");F(s.appIconPickerModal.invalidFileTypeError.replace("{types}",J));return}if(B.size>V){const J=(V/1048576).toFixed(0);F(s.appIconPickerModal.fileTooLargeError.replace("{size}",J));return}_&&URL.revokeObjectURL(_),x(B),w(URL.createObjectURL(B)),F("")},be=async()=>{if(S){k(!0),F("");try{const $=await aR(S.name.split(".").slice(0,-1).join(".")||S.name,S.type,P,R),B=await iR($,S.name);await lR(B,S,O);const le=B.split("?")[0],ge=await cR($,le,S.type);r(ge)}catch($){F($ instanceof Error?$.message:s.appIconPickerModal.uploadFailedError)}finally{k(!1)}}},Te=u.length<f;return l.jsx("div",{className:je.overlay,role:"dialog","aria-modal":"true","aria-label":s.appIconPickerModal.dialogAriaLabel,children:l.jsxs("div",{className:je.modal,children:[l.jsxs("div",{className:je.header,children:[l.jsx("span",{className:je.title,children:s.appIconPickerModal.title}),l.jsx("button",{className:je.closeBtn,onClick:n,"aria-label":s.appIconPickerModal.closeAriaLabel,children:l.jsx(Mr,{size:18})})]}),l.jsxs("div",{className:je.tabs,role:"tablist",children:[l.jsx("button",{role:"tab","aria-selected":o==="my",className:`${je.tab} ${o==="my"?je.activeTab:""}`,onClick:()=>a("my"),children:s.appIconPickerModal.myImagesTab}),l.jsx("button",{role:"tab","aria-selected":o==="all",className:`${je.tab} ${o==="all"?je.activeTab:""}`,onClick:()=>a("all"),children:s.appIconPickerModal.allImagesTab}),l.jsxs("button",{role:"tab","aria-selected":o==="upload",className:`${je.tab} ${o==="upload"?je.activeTab:""}`,onClick:()=>a("upload"),children:[l.jsx(dl,{size:13,style:{marginRight:4}}),s.appIconPickerModal.uploadTab]})]}),l.jsx("div",{className:je.body,children:o!=="upload"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:je.searchWrap,children:[l.jsx(ya,{size:14,className:je.searchIcon}),l.jsx("input",{type:"search",className:je.searchInput,placeholder:s.appIconPickerModal.searchPlaceholder,value:i,onChange:$=>ie($.target.value)})]}),h&&u.length===0?l.jsxs("div",{className:je.loadingRow,children:[l.jsx(Ko,{size:20,className:je.spinner}),l.jsx("span",{children:s.appIconPickerModal.loadingText})]}):u.length===0?l.jsx("div",{className:je.empty,children:s.appIconPickerModal.noImagesFound}):l.jsx("div",{className:je.grid,children:u.map($=>{const B=$.appIcon??$.artifactUrl??$.downloadUrl??"",le=(p==null?void 0:p.identifier)===$.identifier;return l.jsxs("button",{type:"button",className:`${je.imgCell} ${le?je.imgCellSelected:""}`,onClick:()=>v($),title:$.name,children:[B?l.jsx("img",{src:B,alt:$.name,className:je.thumb}):l.jsx("div",{className:je.noThumb,children:s.appIconPickerModal.noThumbnailText}),le&&l.jsx("div",{className:je.checkBadge,children:l.jsx(Es,{size:12})})]},$.identifier)})}),Te&&!h&&l.jsx("button",{className:je.loadMoreBtn,onClick:ve,children:s.appIconPickerModal.loadMoreButton}),h&&u.length>0&&l.jsx("div",{className:je.loadingRow,children:l.jsx(Ko,{size:16,className:je.spinner})})]}):l.jsxs("div",{className:je.uploadArea,children:[l.jsx("div",{className:je.dropZone,onClick:()=>{var $;return($=I.current)==null?void 0:$.click()},onDragOver:$=>$.preventDefault(),onDrop:$=>{$.preventDefault();const B=$.dataTransfer.files[0];B&&H({target:{files:[B],value:""}})},children:_?l.jsx("img",{src:_,alt:s.appIconPickerModal.previewAlt,className:je.uploadPreview}):l.jsxs(l.Fragment,{children:[l.jsx(dl,{size:32,className:je.uploadIcon}),l.jsx("p",{className:je.dropText,children:s.appIconPickerModal.dropZoneText}),l.jsx("p",{className:je.dropSubtext,children:s.appIconPickerModal.acceptedTypesInfo.replace("{types}",ne.split(",").map($=>$.replace("image/","").toUpperCase()).join(", ")).replace("{size}",(V/(1024*1024)).toFixed(0))})]})}),l.jsx("input",{ref:I,type:"file",accept:ne,className:je.hiddenInput,onChange:H}),S&&l.jsx("p",{className:je.fileName,children:S.name}),N&&l.jsx("p",{className:je.errorText,children:N})]})}),l.jsxs("div",{className:je.footer,children:[l.jsx("button",{className:je.cancelBtn,onClick:n,children:s.appIconPickerModal.cancelButton}),o==="upload"?l.jsx("button",{className:je.confirmBtn,disabled:!S||E,onClick:be,children:E?l.jsxs(l.Fragment,{children:[l.jsx(Ko,{size:14,className:je.spinner})," ",s.appIconPickerModal.uploadingText]}):s.appIconPickerModal.uploadAndUseButton}):l.jsx("button",{className:je.confirmBtn,disabled:!p,onClick:me,children:s.appIconPickerModal.useSelectedButton})]})]})})},HR=({name:e,label:t,nodeId:r,required:n,disabled:s})=>{const o=fe(),[a,i]=g.useState(!1),{watch:c,setValue:u,register:d,formState:{errors:f}}=vr(),m=c(e),h=f[e],b=v=>{u(e,v,{shouldDirty:!0,shouldValidate:!0}),i(!1)},p=()=>{u(e,"",{shouldDirty:!0,shouldValidate:!0})};return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...d(e,{required:n?o.appIconField.requiredError.replace("{field}",t):!1})}),l.jsx("div",{className:M.iconWrap,role:"button",tabIndex:s?-1:0,"aria-label":o.appIconField.selectIconAriaLabel,onClick:()=>!s&&i(!0),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&!s&&i(!0)},children:m?l.jsx("img",{src:m,alt:o.appIconField.iconAlt,className:M.iconPreview}):l.jsxs("div",{className:M.iconPlaceholder,children:[l.jsx(Ph,{size:20}),l.jsx("span",{children:o.appIconField.selectIconLabel})]})}),m&&!s&&l.jsxs("button",{type:"button",className:M.removeIconBtn,onClick:p,"aria-label":o.appIconField.removeIconAriaLabel,children:[l.jsx(ks,{size:13}),l.jsx("span",{children:o.appIconField.removeLabel})]}),h&&l.jsx("span",{className:M.error,children:String(h.message)}),a&&l.jsx(Jm,{nodeId:r,currentValue:m,onSelect:b,onClose:()=>i(!1)})]})},zR=({name:e,label:t,required:r,disabled:n})=>{const s=fe(),{control:o}=vr(),{field:a,fieldState:{error:i}}=Do({name:e,control:o,rules:{required:r?s.dateTimeField.requiredError.replace("{field}",t):!1}});return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{id:e,type:"datetime-local",className:[M.input,i?M.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:a.onChange,onBlur:a.onBlur,ref:a.ref}),i&&l.jsx("span",{className:M.error,children:String(i.message)})]})},QR=({name:e,label:t,required:r,disabled:n})=>{const s=fe(),{control:o}=vr(),{field:a,fieldState:{error:i}}=Do({name:e,control:o,rules:{required:r?s.keywordSuggestField.requiredError.replace("{field}",t):!1},defaultValue:[]}),[c,u]=g.useState(""),d=g.useRef(null),f=a.value??[],m=v=>{const y=v.trim();!y||f.includes(y)||a.onChange([...f,y])},h=v=>{a.onChange(f.filter(y=>y!==v))},b=v=>{v.key==="Enter"||v.key===","?(v.preventDefault(),m(c),u("")):v.key==="Backspace"&&c===""&&f.length>0&&h(f[f.length-1])},p=()=>{c.trim()&&(m(c),u("")),a.onBlur()};return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:[M.chipGroup,i?M.inputError:""].join(" "),onClick:()=>{var v;return!n&&((v=d.current)==null?void 0:v.focus())},style:{cursor:n?"not-allowed":"text"},children:[f.map(v=>l.jsxs("span",{className:M.tagChip,children:[v,!n&&l.jsx("button",{type:"button",className:M.tagChipRemove,onClick:y=>{y.stopPropagation(),h(v)},"aria-label":`Remove ${v}`,children:l.jsx(Mr,{size:11})})]},v)),!n&&l.jsx("input",{ref:d,className:M.chipInput,value:c,onChange:v=>u(v.target.value),onKeyDown:b,onBlur:p,placeholder:f.length===0?s.keywordSuggestField.inputPlaceholder:"",style:{flexGrow:1,minWidth:120}})]}),i&&l.jsx("span",{className:M.error,children:String(i.message)})]})},WR=({name:e,label:t,levels:r,required:n,disabled:s})=>{const o=fe(),{control:a}=vr(),{field:i,fieldState:{error:c}}=Do({name:e,control:a,rules:{required:n?o.nestedSelectField.requiredError.replace("{field}",t):!1},defaultValue:{}}),u=i.value??{},d=(f,m,h)=>{const b={};for(let p=0;p<m;p++)b[r[p].code]=u[r[p].code]??"";b[f]=h;for(let p=m+1;p<r.length;p++)b[r[p].code]="";i.onChange(b)};return l.jsxs("div",{className:[M.field,M.fullWidth].join(" "),children:[l.jsxs("label",{className:M.label,children:[t,n&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("div",{className:M.nestedSelectRow,children:r.map((f,m)=>{const h=m>0&&!u[r[m-1].code];return l.jsxs("div",{className:M.field,style:{flex:1},children:[l.jsx("label",{className:M.label,htmlFor:`${e}_${f.code}`,children:f.label}),l.jsxs("select",{id:`${e}_${f.code}`,className:[M.input,c?M.inputError:""].join(" "),disabled:s||h,value:u[f.code]??"",onChange:b=>d(f.code,m,b.target.value),onBlur:i.onBlur,children:[l.jsx("option",{value:"",children:o.nestedSelectField.selectPlaceholder}),f.options.map(b=>l.jsx("option",{value:b.value,children:b.label},b.value))]})]},f.code)})}),c&&l.jsx("span",{className:M.error,children:String(c.message)})]})},cf=[{label:"CC BY 4.0",value:"CC BY 4.0"},{label:"CC BY-SA 4.0",value:"CC BY-SA 4.0"},{label:"CC BY-NC 4.0",value:"CC BY-NC 4.0"},{label:"CC BY-NC-SA 4.0",value:"CC BY-NC-SA 4.0"},{label:"CC BY-ND 4.0",value:"CC BY-ND 4.0"},{label:"CC0 1.0 (Public Domain)",value:"CC0 1.0"}],GR=({name:e,label:t,required:r,disabled:n})=>{const s=fe(),[o,a]=g.useState(!1),i=g.useRef(null),{register:c,watch:u,setValue:d,formState:{errors:f}}=vr(),m=u(e),h=cf.find(v=>v.value===m),b=(h==null?void 0:h.label)??s.licenseSelectField.selectPlaceholder,p=f[e];return g.useEffect(()=>{if(!o)return;const v=y=>{var C;(C=i.current)!=null&&C.contains(y.target)||a(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[o]),l.jsxs("div",{className:M.field,ref:i,style:{position:"relative"},children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx("input",{type:"hidden",...c(e,{required:r?s.licenseSelectField.requiredError.replace("{field}",t):!1})}),l.jsxs("button",{type:"button",disabled:n,className:[M.selectBtn,p?M.inputError:"",o?M.selectOpen:""].join(" "),onClick:()=>a(v=>!v),"aria-haspopup":"listbox","aria-expanded":o,children:[l.jsx("span",{className:m?M.selectedVal:M.placeholder,children:b}),l.jsx(bn,{size:14,className:o?M.chevronUp:""})]}),o&&l.jsx("div",{className:M.dropdown,role:"listbox",children:cf.map(v=>l.jsxs("button",{type:"button",role:"option","aria-selected":m===v.value,className:[M.option,m===v.value?M.optionSelected:""].join(" "),onClick:()=>{d(e,v.value,{shouldDirty:!0,shouldValidate:!0}),a(!1)},children:[l.jsx("span",{children:v.label}),m===v.value&&l.jsx(Es,{size:13})]},v.value))}),p&&l.jsx("span",{className:M.error,children:String(p.message)})]})},KR=({name:e,label:t,required:r,disabled:n})=>{const s=fe(),{control:o}=vr(),{field:a,fieldState:{error:i}}=Do({name:e,control:o,rules:{required:r?s.dialcodeInputField.requiredError.replace("{field}",t):!1},defaultValue:""}),[c,u]=g.useState("idle"),[d,f]=g.useState(""),m=async()=>{const b=(a.value??"").trim();if(!b){u("invalid"),f(s.dialcodeInputField.enterCodeMessage);return}u("loading"),f("");try{const p=await z1(b),v=p==null?void 0:p.result,y=v==null?void 0:v.dialcodes;Array.isArray(y)&&y.length>0?(u("valid"),f(s.dialcodeInputField.validMessage)):(u("invalid"),f(s.dialcodeInputField.notFoundMessage))}catch{u("invalid"),f(s.dialcodeInputField.validationFailedMessage)}},h=()=>c==="loading"?l.jsx(Ko,{size:16,className:M.dialcodeSpinner}):c==="valid"?l.jsx(jh,{size:16,color:"var(--sbx-success, #2e7d32)"}):c==="invalid"?l.jsx(Ob,{size:16,color:"var(--sbx-error)"}):null;return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,htmlFor:e,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsxs("div",{className:M.dialcodeRow,children:[l.jsx("input",{id:e,type:"text",className:[M.input,i?M.inputError:""].join(" "),disabled:n,value:a.value??"",onChange:b=>{a.onChange(b),u("idle"),f("")},onBlur:a.onBlur,ref:a.ref,placeholder:s.dialcodeInputField.placeholderExample,style:{flex:1}}),l.jsx("button",{type:"button",className:M.validateBtn,onClick:m,disabled:n||c==="loading","aria-label":s.dialcodeInputField.validateAriaLabel,children:c==="loading"?s.dialcodeInputField.validatingLabel:s.dialcodeInputField.validateButtonLabel}),h()]}),i&&l.jsx("span",{className:M.error,children:String(i.message)}),!i&&d&&l.jsx("span",{className:c==="valid"?M.dialcodeValid:M.error,children:d})]})},YR="_cards_1j7eu_1",ZR="_card_1j7eu_1",XR="_cardActive_1j7eu_30",JR="_cardIcon_1j7eu_35",eP="_cardIconPrimary_1j7eu_46",tP="_cardIconHover_1j7eu_50",rP="_radioDot_1j7eu_54",nP="_radioDotActive_1j7eu_65",sP="_cardTitle_1j7eu_70",oP="_cardTitleInk_1j7eu_76",aP="_cardDescription_1j7eu_80",iP="_cardDescriptionCharcoal_1j7eu_86",rr={cards:YR,card:ZR,cardActive:XR,cardIcon:JR,cardIconPrimary:eP,cardIconHover:tP,radioDot:rP,radioDotActive:nP,cardTitle:sP,cardTitleInk:oP,cardDescription:aP,cardDescriptionCharcoal:iP},lP=({name:e,label:t,required:r,disabled:n})=>{const s=fe(),{control:o}=vr(),a=[{value:"strict",Icon:Fh,iconVariant:rr.cardIconPrimary,title:s.learningPath.policyStrictLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyStrictDescription}),descriptionVariant:""},{value:"adaptive",Icon:nC,iconVariant:rr.cardIconPrimary,title:s.learningPath.policyAdaptiveLabel,titleVariant:rr.cardTitleInk,description:l.jsxs(l.Fragment,{children:[s.learningPath.policyAdaptiveDescriptionPre,l.jsx("span",{className:M.required,children:"*"}),s.learningPath.policyAdaptiveDescriptionPost]}),descriptionVariant:rr.cardDescriptionCharcoal},{value:"priorLearning",Icon:Yb,iconVariant:rr.cardIconHover,title:s.learningPath.policyPriorLearningLabel,titleVariant:"",description:l.jsx(l.Fragment,{children:s.learningPath.policyPriorLearningDescription}),descriptionVariant:""}];return l.jsxs("div",{className:M.field,children:[l.jsxs("label",{className:M.label,children:[t,r&&l.jsx("span",{className:M.required,children:"*"})]}),l.jsx(vO,{name:e,control:o,rules:{required:r?s.selectField.requiredError.replace("{field}",t):!1},render:({field:i})=>l.jsx("div",{className:rr.cards,children:a.map(({value:c,Icon:u,iconVariant:d,title:f,titleVariant:m,description:h,descriptionVariant:b})=>{const p=i.value===c;return l.jsxs("button",{type:"button",disabled:n,className:[rr.card,p?rr.cardActive:""].join(" "),onClick:()=>i.onChange(c),children:[l.jsx("span",{className:[rr.cardIcon,d].join(" "),children:l.jsx(u,{size:16})}),l.jsx("span",{className:[rr.radioDot,p?rr.radioDotActive:""].join(" ")}),l.jsx("span",{className:[rr.cardTitle,m].join(" "),children:f}),l.jsx("span",{className:[rr.cardDescription,b].join(" "),children:h})]},c)})})})]})},cP="_form_lktqh_1",uP="_formLp_lktqh_7",dP="_ungrouped_lktqh_12",fP="_ungroupedLp_lktqh_23",hP="_fullWidthField_lktqh_27",pP="_noFields_lktqh_31",Jn={form:cP,formLp:uP,ungrouped:dP,ungroupedLp:fP,fullWidthField:hP,noFields:pP},uf=e=>e==null||e===""||Array.isArray(e)&&e.length===0,mP=({nodeMetadata:e,activeTab:t,isRoot:r,isFolder:n,editorMode:s,onFormValueChange:o,onFormStatusChange:a})=>{var zt,Ut,Dt,Jt,Br,ut,yr,er,cr,Zr,Xr;const i=fe(),c=Z(q=>q.editorConfig),u=Z(q=>q.editorProfile),d=u.key==="learningPath",f=Z(q=>q.rootFormConfig),m=Z(q=>q.unitFormConfig),h=Z(q=>q.categoryMeta),b=Z(q=>q.contentFramework),p=Z(q=>q.contentTargetFWIds),{organisationFramework:v,targetFrameworks:y,isLoading:C}=Xa(b??((zt=c==null?void 0:c.context)==null?void 0:zt.framework),p??((Ut=c==null?void 0:c.context)==null?void 0:Ut.targetFWIds)),{frameworks:S,collectionAdditionalCategories:x,contentAdditionalCategories:_,defaultLicense:w,name:E}=RO((Dt=c==null?void 0:c.context)==null?void 0:Dt.channel),k=PO(((Jt=c==null?void 0:c.context)==null?void 0:Jt.userId)??((Br=c==null?void 0:c.context)==null?void 0:Br.uid)),N=NO(S,(ut=h==null?void 0:h.frameworkMetadata)==null?void 0:ut.orgFWType,(yr=c==null?void 0:c.context)==null?void 0:yr.channel),F=ae(q=>q.selectedNodeId),I=ae(q=>q.treeData),R=ae(q=>q.treeCache),P=F?R[F]??{}:{},O={...e,...P},V=O.primaryCategory??((er=c==null?void 0:c.config)==null?void 0:er.primaryCategory),ne=r&&!d&&(V==="Course"||V===uc),W=r&&d,{frameworks:ue,isLoaded:ie}=Rp((cr=c==null?void 0:c.context)==null?void 0:cr.channel,ne||W),ve=typeof O.competencyFramework=="string"?O.competencyFramework:void 0,me=g.useMemo(()=>ue.map(q=>({label:q.name,value:q.identifier})),[ue]),H=(ne||W)&&ve&&ue.some(q=>q.identifier===ve)?ve:void 0,{skills:be,skillField:Te}=hc(ne?H:void 0),$=g.useRef(Te);$.current=Te;const{roles:B}=Pp(W?H:void 0),le=g.useMemo(()=>B.map(q=>({label:q.name,value:q.id})),[B]),ge=g.useRef(O.targetRole);ge.current=O.targetRole;const J=g.useRef(B);J.current=B;const de=g.useRef(ve);de.current=ve;const X=g.useRef(O.framework);X.current=O.framework;const Ce={organisationFramework:v,targetFrameworks:y,orgFrameworks:N,channelAdditionalCategories:x,...ne||W?{competency:{frameworks:me,frameworksLoaded:ie,skills:be,skillField:Te,...W?{roles:le}:{}}}:{}},Ne=g.useMemo(()=>{var ye;if(!F)return 0;const q=[...I];for(;q.length;){const Ae=q.shift();if(Ae.id===F)return((ye=Ae.children)==null?void 0:ye.length)??0;Ae.children&&q.push(...Ae.children)}return 0},[I,F]),re=(c==null?void 0:c.config)??{},ce=(c==null?void 0:c.context)??{},G={editorMode:s,editableFields:re.editableFields,objectType:re.objectType,setDefaultCopyRight:re.setDefaultCopyRight===!0,defaultLicense:ce.defaultLicense??w,contextAdditionalCategories:ce.additionalCategories,userFullName:((Zr=ce.user)==null?void 0:Zr.fullName)??k,channelName:E,collectionAdditionalCategories:x,contentAdditionalCategories:_,childCount:Ne,profile:u,competencyLabels:i.sparkMetaForm},U=r?f:m,Ee=U||(((Xr=c==null?void 0:c.config.hierarchy)==null?void 0:Xr.formConfig)??[]),we=Wm(Ee,O,Ce,r,G),ke=we.filter(q=>q.tab===t&&q.inputType!=="appIcon"&&q.visible!==!1),xe=OO({mode:"onChange",defaultValues:Object.fromEntries(we.map(q=>{const ye=["multiselect","chips","keywords","tagsinput"],Ae=["nestedselect"];return ye.includes(q.inputType)?[q.code,q.currentValue??q.defaultValue??[]]:Ae.includes(q.inputType)?[q.code,q.currentValue??q.defaultValue??{}]:[q.code,q.currentValue??q.defaultValue??""]}))});fN(xe,we);const Pe=g.useRef(!1),qt=(q,ye)=>{Pe.current=!0;try{xe.setValue(q,ye,{shouldDirty:!1})}finally{Pe.current=!1}},{updateNode:lr}=ae(),$t=g.useRef(we);$t.current=we;const Lt=g.useRef(F);Lt.current=F;const T=g.useRef(o);T.current=o;const D=g.useRef(a);D.current=a;const j=g.useRef(typeof O.shuffle=="boolean"?O.shuffle:void 0),z=g.useRef(O.name??"");z.current=O.name??"";const Q=g.useRef(s);Q.current=s;const K=kr(),Y=g.useRef(K==null?void 0:K.code);Y.current=K==null?void 0:K.code;const he=g.useRef(K==null?void 0:K.terms);he.current=K==null?void 0:K.terms;const De=["review","read","sourcingreview","orgreview"],Ze=()=>{xe.trigger().then(()=>{const q=xe.formState.errors,ye=$t.current,Ae=Array.from(new Set(Object.keys(q).map(br=>{var Jr;return(Jr=ye.find(Qt=>Qt.code===br))==null?void 0:Jr.tab}).filter(Boolean)));D.current(Object.keys(q).length===0,Ae)})};g.useEffect(()=>{const q=Lt.current;if(q){const ye=Object.fromEntries($t.current.filter(Ae=>Ae.currentValue!==void 0&&Ae.currentValue!==null).map(Ae=>[Ae.code,Ae.currentValue]));Object.keys(ye).length>0&&lr(q,ye,void 0,{silent:!0})}Ze()},[]);const It=we.map(q=>q.code).join("|"),gt=g.useRef(we.map(q=>q.code));g.useEffect(()=>{const q=$t.current,ye=new Set(q.map(Qt=>Qt.code)),Ae=new Set(gt.current),br=gt.current.filter(Qt=>!ye.has(Qt)),Jr=q.filter(Qt=>!Ae.has(Qt.code));if(gt.current=Array.from(ye),br.length){Pe.current=!0;try{xe.unregister(br,{keepValue:!0,keepDefaultValue:!0})}finally{Pe.current=!1}}for(const Qt of Jr){const js=Qt.currentValue;uf(js)||!uf(xe.getValues(Qt.code))||qt(Qt.code,js)}(br.length||Jr.length)&&Ze()},[It]),g.useEffect(()=>{const q=xe.watch((ye,{name:Ae})=>{var Rc,Pc;const br=Lt.current;if(!br)return;const Jr=$t.current,Qt=new Set(Jr.map(Je=>Je.code));if(Ae&&Qt.has(Ae)){let Je=xe.getValues(Ae);if(Ae==="dialcodes"&&(Je=Array.isArray(Je)?Je:Je?[Je]:[]),Ae==="shuffle"&&(Je===!0&&j.current===!1&&Se(i.sparkMetaForm.shuffleEnabledMessage,{icon:l.jsx(Vr,{size:16})}),j.current=Je),Ae==="framework"&&r&&typeof Je=="string"&&Je){const wt=Z.getState();if(wt.setContentFramework(Je,wt.contentTargetFWIds),d&&!de.current&&Je!==X.current){const tr=ae.getState().pruneCoursesByFramework(Je);tr>0&&Se(i.learningPath.coursesRemovedFrameworkChangeToast.replace("{count}",String(tr)),{icon:l.jsx(Vr,{size:16}),duration:5e3});const en=ae.getState().clearLevelSkills(Y.current);en>0&&Se(i.learningPath.levelSkillsResetFrameworkChangeToast.replace("{count}",String(en)),{icon:l.jsx(Vr,{size:16}),duration:5e3})}}let Lr=!1,ur;if(Ae==="competencyFramework"&&r&&d&&Je!==de.current){Lr=!!xe.getValues("targetRole"),Lr&&xe.setValue("targetRole","",{shouldDirty:!0});const wt=Y.current,tr=ae.getState().treeData[0],en=wt&&tr?((Rc=ae.getState().treeCache[tr.id])==null?void 0:Rc[wt])??((Pc=tr.metadata)==null?void 0:Pc[wt]):void 0;wt&&(Array.isArray(en)?en.length>0:en)&&(ur=wt),(Lr||ur)&&Se(i.learningPath.skillFrameworkChangedToast,{icon:l.jsx(Vr,{size:16}),duration:5e3})}if(Ae==="targetRole"&&r&&d&&typeof Je=="string"&&Je&&Je!==ge.current){const wt=J.current.find(en=>en.id===Je),tr=wt?bp(ae.getState().treeData[0],wt.skills,Y.current,he.current).length:0;tr>0&&Se(i.learningPath.roleChangedCoursesFlaggedToast.replace("{count}",String(tr)),{icon:l.jsx(Vr,{size:16}),duration:6e3})}if(Ae==="competencyFramework"&&r&&!d&&Je!==de.current){const wt=$.current,tr=wt?xe.getValues(wt):void 0;wt&&(Array.isArray(tr)?tr.length>0:tr)&&(ur=wt,xe.setValue(wt,[],{shouldDirty:!0}))}const Os=dN(Ae,Je),ii=Os&&(ur||Lr)?{...Os,...ur?{[ur]:[]}:{},...Lr?{targetRole:""}:{}}:Os;ii&&(lr(br,ii,void 0,Pe.current?{silent:!0}:void 0),T.current(ii))}else if(!Ae){const Je=xe.getValues(),Lr=Object.fromEntries(Object.entries(Je).filter(([Os])=>Qt.has(Os))),ur=uN(Lr,{isReview:De.includes(Q.current),nodeTitle:z.current});Object.keys(ur).length>0&&(lr(br,ur,void 0,Pe.current?{silent:!0}:void 0),T.current(ur))}const js=xe.formState.errors,Cg=Array.from(new Set(Object.keys(js).map(Je=>{var Lr;return(Lr=Jr.find(ur=>ur.code===Je))==null?void 0:Lr.tab}).filter(Boolean)));D.current(Object.keys(js).length===0,Cg)});return()=>q.unsubscribe()},[xe]),g.useEffect(()=>{for(const q of["author","creator","copyright","copyrightYear","license"]){const ye=$t.current.find(br=>br.code===q);if(!ye||ye.currentValue===void 0||ye.currentValue===null||ye.currentValue==="")continue;const Ae=xe.getValues(q);(Ae==null||Ae==="")&&qt(q,ye.currentValue)}},[k,E,xe]);const lt=we.find(q=>q.isSkillField&&q.editable!==!1),Yr=JSON.stringify((lt==null?void 0:lt.currentValue)??null);g.useEffect(()=>{lt&&JSON.stringify(xe.getValues(lt.code)??null)!==Yr&&qt(lt.code,lt.currentValue)},[lt==null?void 0:lt.code,Yr,xe]);const Ar=[ir,wn].map(q=>{var ye;return[q,(ye=we.find(Ae=>Ae.code===q))==null?void 0:ye.currentValue]}),ct=JSON.stringify(Ar);g.useEffect(()=>{for(const[q,ye]of Ar)ye&&xe.getValues(q)!==ye&&qt(q,ye)},[ct,xe]);const vt=ke.reduce((q,ye)=>{const Ae=q[q.length-1];return Ae&&Ae.section===ye.section?Ae.fields.push(ye):q.push({section:ye.section,fields:[ye]}),q},[]),yt=q=>{const ye={key:q.code,name:q.code,label:q.label,required:q.required,disabled:q.editable===!1};if(d&&q.code==="policy")return l.jsx("div",{className:Jn.fullWidthField,children:l.jsx(lP,{...ye})},q.code);switch(q.inputType){case"textarea":return l.jsx(af,{...ye,multiline:!0,maxLength:q.maxLength});case"select":return l.jsx(rR,{...ye,options:q.options??[]});case"multiselect":return l.jsx(nR,{...ye,options:q.options??[]});case"chips":return l.jsx(sR,{...ye});case"radio":return l.jsx(oR,{...ye,options:q.options??[]});case"appIcon":return l.jsx(HR,{...ye,nodeId:F??""});case"datepicker":case"datetime":return l.jsx(zR,{...ye});case"keywords":case"tagsinput":return l.jsx(QR,{...ye});case"nestedselect":return l.jsx(WR,{...ye,levels:q.levels??[]});case"license":return l.jsx(GR,{...ye});case"dialcode":return l.jsx(KR,{...ye});default:return l.jsx(af,{...ye,maxLength:q.maxLength})}};return l.jsx(yO,{...xe,children:l.jsxs("div",{className:[Jn.form,d?Jn.formLp:""].filter(Boolean).join(" "),children:[vt.map((q,ye)=>{const Ae=q.section?FO[q.section]:void 0;return Ae?l.jsx(bN,{title:Ae.title,description:Ae.description,children:q.fields.map(yt)},q.section??ye):l.jsx("div",{className:[Jn.ungrouped,d?Jn.ungroupedLp:""].filter(Boolean).join(" "),children:q.fields.map(yt)},ye)}),ke.length===0&&!C&&l.jsx("p",{className:Jn.noFields,children:i.sparkMetaForm.noFieldsMessage})]})})};function eg(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function gP(e,t){return e.reduce((r,n,s)=>{const o=t.get(n);return o&&(r[s]=o),r},Array(e.length))}function Vo(e){return e!==null&&e>=0}function vP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function yP(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const tg=e=>{let{rects:t,activeIndex:r,overIndex:n,index:s}=e;const o=eg(t,n,r),a=t[s],i=o[s];return!i||!a?null:{x:i.left-a.left,y:i.top-a.top,scaleX:i.width/a.width,scaleY:i.height/a.height}},Ho={scaleX:1,scaleY:1},df=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:s,rects:o,overIndex:a}=e;const i=(t=o[r])!=null?t:n;if(!i)return null;if(s===r){const u=o[a];return u?{x:0,y:r<a?u.top+u.height-(i.top+i.height):u.top-i.top,...Ho}:null}const c=bP(o,s,r);return s>r&&s<=a?{x:0,y:-i.height-c,...Ho}:s<r&&s>=a?{x:0,y:i.height+c,...Ho}:{x:0,y:0,...Ho}};function bP(e,t,r){const n=e[t],s=e[t-1],o=e[t+1];return n?r<t?s?n.top-(s.top+s.height):o?o.top-(n.top+n.height):0:o?o.top-(n.top+n.height):s?n.top-(s.top+s.height):0:0}const rg="Sortable",ng=g.createContext({activeIndex:-1,containerId:rg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:tg,disabled:{draggable:!1,droppable:!1}});function ff(e){let{children:t,id:r,items:n,strategy:s=tg,disabled:o=!1}=e;const{active:a,dragOverlay:i,droppableRects:c,over:u,measureDroppableContainers:d}=Ih(),f=bo(rg,r),m=i.rect!==null,h=g.useMemo(()=>n.map(w=>typeof w=="object"&&"id"in w?w.id:w),[n]),b=a!=null,p=a?h.indexOf(a.id):-1,v=u?h.indexOf(u.id):-1,y=g.useRef(h),C=!vP(h,y.current),S=v!==-1&&p===-1||C,x=yP(o);wr(()=>{C&&b&&d(h)},[C,h,b,d]),g.useEffect(()=>{y.current=h},[h]);const _=g.useMemo(()=>({activeIndex:p,containerId:f,disabled:x,disableTransforms:S,items:h,overIndex:v,useDragOverlay:m,sortedRects:gP(h,c),strategy:s}),[p,f,x.draggable,x.droppable,S,h,v,c,m,s]);return g.createElement(ng.Provider,{value:_},t)}const CP=e=>{let{id:t,items:r,activeIndex:n,overIndex:s}=e;return eg(r,n,s).indexOf(t)},SP=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:s,items:o,newIndex:a,previousItems:i,previousContainerId:c,transition:u}=e;return!u||!n||i!==o&&s===a?!1:r?!0:a!==s&&t===c},xP={duration:200,easing:"ease"},sg="transform",_P=Wr.Transition.toString({property:sg,duration:0,easing:"linear"}),wP={roleDescription:"sortable"};function TP(e){let{disabled:t,index:r,node:n,rect:s}=e;const[o,a]=g.useState(null),i=g.useRef(r);return wr(()=>{if(!t&&r!==i.current&&n.current){const c=s.current;if(c){const u=Ts(n.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&a(d)}}r!==i.current&&(i.current=r)},[t,r,n,s]),g.useEffect(()=>{o&&a(null)},[o]),o}function og(e){let{animateLayoutChanges:t=SP,attributes:r,disabled:n,data:s,getNewIndex:o=CP,id:a,strategy:i,resizeObserverConfig:c,transition:u=xP}=e;const{items:d,containerId:f,activeIndex:m,disabled:h,disableTransforms:b,sortedRects:p,overIndex:v,useDragOverlay:y,strategy:C}=g.useContext(ng),S=EP(n,h),x=d.indexOf(a),_=g.useMemo(()=>({sortable:{containerId:f,index:x,items:d},...s}),[f,s,x,d]),w=g.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:k,isOver:N,setNodeRef:F}=db({id:a,data:_,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:I,activatorEvent:R,activeNodeRect:P,attributes:O,setNodeRef:V,listeners:ne,isDragging:W,over:ue,setActivatorNodeRef:ie,transform:ve}=Lh({id:a,data:_,attributes:{...wP,...r},disabled:S.draggable}),me=Zv(F,V),H=!!I,be=H&&!b&&Vo(m)&&Vo(v),Te=!y&&W,$=Te&&be?ve:null,le=be?$??(i??C)({rects:p,activeNodeRect:P,activeIndex:m,overIndex:v,index:x}):null,ge=Vo(m)&&Vo(v)?o({id:a,items:d,activeIndex:m,overIndex:v}):x,J=I==null?void 0:I.id,de=g.useRef({activeId:J,items:d,newIndex:ge,containerId:f}),X=d!==de.current.items,Ce=t({active:I,containerId:f,isDragging:W,isSorting:H,id:a,index:x,items:d,newIndex:de.current.newIndex,previousItems:de.current.items,previousContainerId:de.current.containerId,transition:u,wasDragging:de.current.activeId!=null}),Ne=TP({disabled:!Ce,index:x,node:k,rect:E});return g.useEffect(()=>{H&&de.current.newIndex!==ge&&(de.current.newIndex=ge),f!==de.current.containerId&&(de.current.containerId=f),d!==de.current.items&&(de.current.items=d)},[H,ge,f,d]),g.useEffect(()=>{if(J===de.current.activeId)return;if(J&&!de.current.activeId){de.current.activeId=J;return}const ce=setTimeout(()=>{de.current.activeId=J},50);return()=>clearTimeout(ce)},[J]),{active:I,activeIndex:m,attributes:O,data:_,rect:E,index:x,newIndex:ge,items:d,isOver:N,isSorting:H,isDragging:W,listeners:ne,node:k,overIndex:v,over:ue,setNodeRef:me,setActivatorNodeRef:ie,setDroppableNodeRef:F,setDraggableNodeRef:V,transform:Ne??le,transition:re()};function re(){if(Ne||X&&de.current.newIndex===x)return _P;if(!(Te&&!Na(R)||!u)&&(H||Ce))return Wr.Transition.toString({...u,property:sg})}}function EP(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e==null?void 0:e.draggable)!=null?r:t.draggable,droppable:(n=e==null?void 0:e.droppable)!=null?n:t.droppable}}function ka(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const kP=[$e.Down,$e.Right,$e.Up,$e.Left],AP=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:s,droppableContainers:o,over:a,scrollableAncestors:i}}=t;if(kP.includes(e.code)){if(e.preventDefault(),!r||!n)return;const c=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const m=s.get(f.id);if(m)switch(e.code){case $e.Down:n.top<m.top&&c.push(f);break;case $e.Up:n.top>m.top&&c.push(f);break;case $e.Left:n.left>m.left&&c.push(f);break;case $e.Right:n.left<m.left&&c.push(f);break}});const u=hy({collisionRect:n,droppableRects:s,droppableContainers:c});let d=hh(u,"id");if(d===(a==null?void 0:a.id)&&u.length>1&&(d=u[1].id),d!=null){const f=o.get(r.id),m=o.get(d),h=m?s.get(m.id):null,b=m==null?void 0:m.node.current;if(b&&h&&f&&m){const v=Ra(b).some((w,E)=>i[E]!==w),y=ag(f,m),C=LP(f,m),S=v||!y?{x:0,y:0}:{x:C?n.width-h.width:0,y:C?n.height-h.height:0},x={x:h.left,y:h.top};return S.x&&S.y?x:to(x,S)}}}};function ag(e,t){return!ka(e)||!ka(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function LP(e,t){return!ka(e)||!ka(t)||!ag(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const IP="_row_11nth_1",DP="_removeBtn_11nth_14",jP="_grip_11nth_17",OP="_ctIcon_11nth_34",NP="_info_11nth_38",RP="_name_11nth_46",PP="_meta_11nth_55",xn={row:IP,removeBtn:DP,grip:jP,ctIcon:OP,info:NP,name:RP,meta:PP},FP={video:Ha,pdf:So,h5p:$a,scorm:Va,audio:Ua,quiz:qa,course:Fr,default:Cn},MP=({item:e,onRemove:t,isEditable:r})=>{const n=fe(),s=Ao(e),o=FP[s.key]??Cn,{attributes:a,listeners:i,setNodeRef:c,transform:u,transition:d,isDragging:f}=og({id:e.id,disabled:!r}),m={transform:Wr.Transform.toString(u),transition:d,opacity:f?.5:1};return l.jsxs("div",{ref:c,style:m,className:xn.row,role:"listitem",children:[r&&l.jsx("span",{className:xn.grip,...a,...i,"aria-label":n.contentRow.dragToReorderAriaLabel,children:l.jsx(Xl,{size:15})}),l.jsx("span",{className:[`sbx-ct-sq--${s.key}`,xn.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(o,{size:14})}),l.jsxs("div",{className:xn.info,children:[l.jsx("span",{className:xn.name,title:e.name,children:e.name}),l.jsx("span",{className:xn.meta,children:s.label})]}),l.jsx("span",{className:`sbx-ct-badge--${s.key}`,children:s.label}),r&&l.jsx("button",{type:"button",className:xn.removeBtn,onClick:()=>t(e.id),"aria-label":n.contentRow.removeAriaLabel.replace("{name}",e.name),children:l.jsx(Mr,{size:14})})]})},BP="_container_bv5qe_1",qP="_header_bv5qe_7",$P="_heading_bv5qe_13",UP="_count_bv5qe_21",VP="_list_bv5qe_30",HP="_emptyState_bv5qe_36",zP="_skillsCovered_bv5qe_52",QP="_chips_bv5qe_64",WP="_chip_bv5qe_64",GP="_emptyHint_bv5qe_80",KP="_assessmentsCard_bv5qe_93",YP="_assessmentSlots_bv5qe_105",ZP="_assessmentItemRow_bv5qe_111",XP="_assessmentItemIcon_bv5qe_122",JP="_assessmentItemInfo_bv5qe_134",eF="_assessmentItemTitle_bv5qe_141",tF="_assessmentItemMeta_bv5qe_150",rF="_coursesCard_bv5qe_155",nF="_coursesCardTitle_bv5qe_166",sF="_coursesCardDescription_bv5qe_173",oF="_coursesList_bv5qe_180",aF="_courseRow_bv5qe_186",iF="_courseDragHandle_bv5qe_196",lF="_courseIcon_bv5qe_208",cF="_courseInfo_bv5qe_220",uF="_courseTitle_bv5qe_227",dF="_courseMeta_bv5qe_236",fF="_addRowIcon_bv5qe_241",hF="_assessmentItemBadge_bv5qe_253",pF="_menuWrap_bv5qe_264",mF="_menuBtn_bv5qe_269",gF="_dropmenu_bv5qe_282",vF="_dangerItem_bv5qe_312",yF="_addRow_bv5qe_241",bF="_addRowActive_bv5qe_336",CF="_addRowAssessment_bv5qe_342",SF="_addRowText_bv5qe_349",xF="_requiredBadge_bv5qe_354",_F="_chipWarn_bv5qe_365",wF="_warnHint_bv5qe_370",TF="_courseFlag_bv5qe_377",ee={container:BP,header:qP,heading:$P,count:UP,list:VP,emptyState:HP,skillsCovered:zP,chips:QP,chip:WP,emptyHint:GP,assessmentsCard:KP,assessmentSlots:YP,assessmentItemRow:ZP,assessmentItemIcon:XP,assessmentItemInfo:JP,assessmentItemTitle:eF,assessmentItemMeta:tF,coursesCard:rF,coursesCardTitle:nF,coursesCardDescription:sF,coursesList:oF,courseRow:aF,courseDragHandle:iF,courseIcon:lF,courseInfo:cF,courseTitle:uF,courseMeta:dF,addRowIcon:fF,assessmentItemBadge:hF,menuWrap:pF,menuBtn:mF,dropmenu:gF,dangerItem:vF,addRow:yF,addRowActive:bF,addRowAssessment:CF,addRowText:SF,requiredBadge:xF,chipWarn:_F,warnHint:wF,courseFlag:TF},Ml=({slot:e,isEditable:t})=>{const r=fe(),{pre:n,post:s,activeAssessmentSlot:o,setActiveAssessmentSlot:a,deleteSlot:i}=wc(),c=ae(v=>v.selectNode),[u,d]=g.useState(!1),f=g.useRef(null),m=e==="pre"?n:s,h=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel;if(g.useEffect(()=>{if(!u)return;const v=y=>{var C;(C=f.current)!=null&&C.contains(y.target)||d(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[u]),!m.filled){const v=o===e;return l.jsxs("button",{type:"button",className:[ee.addRow,ee.addRowAssessment,v?ee.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:()=>a(v?null:e),"aria-pressed":v,children:[l.jsx("span",{className:ee.addRowIcon,children:l.jsx(Gr,{size:16})}),l.jsx("span",{className:ee.addRowText,children:r.learningPath.addAssessmentSlotButton.replace("{label}",h)}),m.required&&l.jsx("span",{className:ee.requiredBadge,children:r.learningPath.requiredSlotBadge})]})}const b=e==="pre"?r.learningPath.skillCheckBadge:r.learningPath.outcomeCheckBadge,p=()=>m.level&&c(m.level.id);return l.jsxs("div",{className:ee.assessmentItemRow,role:"button",tabIndex:0,onClick:p,onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),p())},children:[l.jsx("span",{className:ee.assessmentItemIcon,children:l.jsx(Fr,{size:16})}),l.jsxs("div",{className:ee.assessmentItemInfo,children:[l.jsx("span",{className:ee.assessmentItemTitle,children:m.courseName||r.learningPath.courseNameUnavailable}),l.jsxs("span",{className:ee.assessmentItemMeta,children:[h," · ",r.learningPath.assessmentCourseMeta]})]}),l.jsx("span",{className:ee.assessmentItemBadge,children:b}),t&&l.jsxs("div",{className:ee.menuWrap,ref:f,children:[l.jsx("button",{type:"button",className:ee.menuBtn,onClick:v=>{v.stopPropagation(),d(y=>!y)},"aria-label":r.treeNode.nodeOptionsAriaLabel,children:"⋮"}),u&&l.jsxs("div",{className:ee.dropmenu,onClick:v=>v.stopPropagation(),children:[l.jsxs("button",{type:"button",onClick:()=>{d(!1),m.level&&c(m.level.id)},children:[l.jsx(Pb,{size:12})," ",r.learningPath.viewCourseMenuItem]}),l.jsxs("button",{type:"button",className:ee.dangerItem,onClick:()=>{d(!1),i(e)},children:[l.jsx(ks,{size:12})," ",r.treeNode.deleteMenuItem]})]})]})]})};function EF(e){var m,h;const t=fe(),r=ae(b=>b.treeData),n=ae(b=>b.deleteNode),s=at(b=>b.activeLevelExamTarget),o=at(b=>b.setActiveLevelExamTarget),a=at(b=>b.openModal),i=(h=(m=r[0])==null?void 0:m.children)==null?void 0:h.find(b=>b.id===e),c=xp(i),u=s===e,d=()=>{e&&o(u?null:e)},f=()=>{c&&a("confirmDelete",{message:t.learningPath.deleteLevelExamConfirm,onConfirm:()=>n(c.id)})};return{course:c,filled:!!c,courseName:c==null?void 0:c.name,isActiveTarget:u,armExam:d,deleteExam:f}}const kF=({levelId:e,isEditable:t})=>{const r=fe(),{filled:n,courseName:s,isActiveTarget:o,armExam:a,deleteExam:i}=EF(e);return n?l.jsxs("div",{className:ee.assessmentItemRow,children:[l.jsx("span",{className:ee.assessmentItemIcon,children:l.jsx(Fr,{size:16})}),l.jsxs("div",{className:ee.assessmentItemInfo,children:[l.jsx("span",{className:ee.assessmentItemTitle,children:s||r.learningPath.courseNameUnavailable}),l.jsx("span",{className:ee.assessmentItemMeta,children:r.learningPath.levelExamMeta})]}),t&&l.jsx("button",{type:"button",className:ee.menuBtn,onClick:i,"aria-label":r.treeNode.deleteMenuItem,children:l.jsx(ks,{size:14})})]}):l.jsxs("button",{type:"button",className:[ee.addRow,ee.addRowAssessment,o?ee.addRowActive:""].filter(Boolean).join(" "),disabled:!t,onClick:a,"aria-pressed":o,children:[l.jsx("span",{className:ee.addRowIcon,children:l.jsx(Gr,{size:16})}),l.jsx("span",{className:ee.addRowText,children:r.learningPath.addLevelExamButton})]})},AF=({item:e,onRemove:t,isEditable:r,notTeachingRole:n=!1})=>{const s=fe(),[o,a]=g.useState(!1),i=g.useRef(null),{attributes:c,listeners:u,setNodeRef:d,transform:f,transition:m,isDragging:h}=og({id:e.id,disabled:!r}),b={transform:Wr.Transform.toString(f),transition:m,opacity:h?.5:1};return g.useEffect(()=>{if(!o)return;const p=v=>{var y;(y=i.current)!=null&&y.contains(v.target)||a(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[o]),l.jsxs("div",{ref:d,style:b,className:ee.courseRow,children:[r&&l.jsx("span",{className:ee.courseDragHandle,...c,...u,"aria-label":s.contentRow.dragToReorderAriaLabel,children:l.jsx(Xl,{size:16})}),l.jsx("span",{className:ee.courseIcon,children:l.jsx(Fr,{size:18})}),l.jsxs("div",{className:ee.courseInfo,children:[l.jsx("span",{className:ee.courseTitle,title:e.name,children:e.name}),l.jsx("span",{className:ee.courseMeta,children:s.learningPath.courseMetaLabel}),n&&l.jsx("span",{className:ee.courseFlag,role:"status",children:s.learningPath.courseNotTeachingRoleBadge})]}),r&&l.jsxs("div",{className:ee.menuWrap,ref:i,children:[l.jsx("button",{type:"button",className:ee.menuBtn,onClick:p=>{p.stopPropagation(),a(v=>!v)},"aria-label":s.treeNode.nodeOptionsAriaLabel,children:"⋮"}),o&&l.jsx("div",{className:ee.dropmenu,onClick:p=>p.stopPropagation(),children:l.jsxs("button",{type:"button",className:ee.dangerItem,onClick:()=>{a(!1),t(e.id)},children:[l.jsx(ks,{size:12})," ",s.learningPath.removeFromLevelMenuItem]})})]})]})},LF=({editorMode:e,isRoot:t=!1})=>{const r=fe(),{selectedNodeId:n,getChildrenOf:s,getNodeById:o,reorderChildren:a,deleteNode:i,treeData:c}=ae(),u=Z(H=>H.editorProfile),d=n?s(n):[],f=e==="edit",m=n?o(n):void 0,h=u.competencyScoped,b=h&&!t&&!ot(m),p=h&&t,v=at(H=>H.activeAssessmentSlot),y=at(H=>H.activeLevelExamTarget),C=at(H=>H.setActiveAssessmentSlot),S=!v&&!y,{scope:x,source:_}=Is(),w=kr(),E=w==null?void 0:w.terms,k=b?ko(m,w==null?void 0:w.code,E):[],N=g.useCallback(H=>Ya(H,E),[E]),F=_==="prior"?k.filter(H=>!x.includes(H)):[],{roleSkills:I}=Kr(),R=p?Cp(c[0],I,w==null?void 0:w.code,E):[],P=p?Sp(c[0]):void 0,O=P&&I.length?I.filter(H=>!Cs(P,w==null?void 0:w.code,E).includes(H)):[],V=p?Ep(c[0],w==null?void 0:w.code,E):[],ne=uh(al(Pa,{activationConstraint:{distance:5}}),al(Gl,{coordinateGetter:AP})),W=g.useCallback(H=>{const{active:be,over:Te}=H;if(!Te||be.id===Te.id||!n)return;const $=ae.getState().getChildrenOf(n),B=$.findIndex(ge=>ge.id===be.id),le=$.findIndex(ge=>ge.id===Te.id);B<0||le<0||a(n,B,le)},[n,a]),ue=g.useCallback(H=>{window.confirm(r.unitContentList.removeConfirm)&&i(H)},[i,r.unitContentList.removeConfirm]),ie=at(H=>H.openModal),ve=g.useCallback(H=>{ie("confirmDelete",{message:r.learningPath.deleteCourseConfirm,onConfirm:()=>{i(H)||Se.error(r.learningPath.cannotRemoveLastRegularCourseToast)}})},[ie,i,r.learningPath.deleteCourseConfirm,r.learningPath.cannotRemoveLastRegularCourseToast]),me=b?d.filter(H=>{var be;return!((be=H.metadata)!=null&&be.isAssessmentCourse)}):[];return n?l.jsxs("div",{className:ee.container,children:[p&&l.jsxs(l.Fragment,{children:[I.length>0?l.jsxs("div",{className:ee.skillsCovered,children:[l.jsx("span",{className:ee.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:ee.emptyHint,children:r.learningPath.roleSkillsCoveredDescription}),l.jsx("div",{className:ee.chips,children:I.map(H=>{const be=R.includes(H);return l.jsxs("span",{className:be?[ee.chip,ee.chipWarn].join(" "):ee.chip,title:be?r.learningPath.roleSkillNotTaughtTitle:r.learningPath.roleSkillTaughtTitle,children:[N(H),be?` · ${r.learningPath.roleSkillNotTaughtSuffix}`:` ${r.learningPath.roleSkillTaughtSuffix}`]},H)})})]}):l.jsxs("div",{className:ee.skillsCovered,children:[l.jsx("span",{className:ee.heading,children:r.learningPath.skillsCoveredHeading}),l.jsx("span",{className:ee.emptyHint,children:r.learningPath.skillsCoveredDescription}),V.length>0&&l.jsx("div",{className:ee.chips,children:V.map(H=>l.jsx("span",{className:ee.chip,children:N(H)},H))}),V.length===0&&l.jsx("span",{className:ee.emptyHint,children:r.learningPath.noSkillsYet})]}),l.jsxs("div",{className:ee.assessmentsCard,children:[l.jsx("span",{className:ee.heading,children:r.learningPath.assessmentsCardHeading}),l.jsx("span",{className:ee.emptyHint,children:r.learningPath.assessmentsCardDescription}),l.jsxs("div",{className:ee.assessmentSlots,children:[l.jsx(Ml,{slot:"pre",isEditable:f}),l.jsx(Ml,{slot:"post",isEditable:f})]}),O.length>0&&l.jsx("span",{className:ee.warnHint,role:"status",children:r.learningPath.priorAssessmentMissingRoleSkills.replace("{skills}",O.map(N).join(", "))})]})]}),b&&l.jsxs("div",{className:ee.skillsCovered,children:[l.jsx("span",{className:ee.heading,children:r.learningPath.skillsHeading}),l.jsx("span",{className:ee.emptyHint,children:r.learningPath.levelSkillsFromCoursesNote}),k.length>0?l.jsx("div",{className:ee.chips,children:k.map(H=>l.jsx("span",{className:F.includes(H)?[ee.chip,ee.chipWarn].join(" "):ee.chip,children:N(H)},H))}):l.jsx("span",{className:ee.emptyHint,children:r.learningPath.levelSkillsEmpty}),F.length>0&&l.jsx("span",{className:ee.warnHint,role:"status",children:r.learningPath.levelSkillsOutsidePrior.replace("{skills}",F.map(N).join(", "))})]}),b&&l.jsxs("div",{className:ee.coursesCard,children:[l.jsx("h3",{className:ee.coursesCardTitle,children:r.learningPath.coursesCardHeading}),l.jsx("p",{className:ee.coursesCardDescription,children:r.learningPath.coursesCardDescription}),me.length>0?l.jsx(ul,{sensors:ne,collisionDetection:Xc,onDragEnd:W,children:l.jsx(ff,{items:me.map(H=>H.id),strategy:df,children:l.jsx("div",{className:ee.coursesList,role:"list",children:me.map(H=>l.jsx(AF,{item:H,onRemove:ve,isEditable:f,notTeachingRole:cc(Cs(H,w==null?void 0:w.code,E),I).length>0},H.id))})})}):l.jsx("span",{className:ee.emptyHint,children:r.learningPath.coursesEmptyHint}),l.jsxs("button",{type:"button",className:[ee.addRow,ee.addRowAssessment,S?ee.addRowActive:""].filter(Boolean).join(" "),disabled:!f,onClick:()=>C(null),"aria-pressed":S,children:[l.jsx("span",{className:ee.addRowIcon,children:l.jsx(Gr,{size:16})}),l.jsx("span",{className:ee.addRowText,children:r.learningPath.addCourseToLevelButton})]}),l.jsx(kF,{levelId:n,isEditable:f})]}),!h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:ee.header,children:[l.jsx("span",{className:ee.heading,children:r.unitContentList.heading}),l.jsx("span",{className:ee.count,children:d.length})]}),d.length>0?l.jsx(ul,{sensors:ne,collisionDetection:Xc,onDragEnd:W,children:l.jsx(ff,{items:d.map(H=>H.id),strategy:df,children:l.jsx("div",{className:ee.list,role:"list",children:d.map(H=>l.jsx(MP,{item:H,onRemove:ue,isEditable:f},H.id))})})}):l.jsxs("div",{className:ee.emptyState,children:[l.jsx("p",{children:r.unitContentList.emptyTitle}),l.jsx("span",{children:r.unitContentList.emptyHint})]}),f&&!ot(m)&&l.jsxs("button",{className:ee.addRow,type:"button","aria-label":r.unitContentList.addContentAriaLabel,children:[l.jsx(Gr,{size:14})," ",r.unitContentList.addContent]})]})]}):null},IF="_dropZone_ijo5w_1",DF="_active_ijo5w_14",hf={dropZone:IF,active:DF},jF=({isActive:e,label:t,nodeId:r,className:n})=>{const s=fe(),o=t??s.dropZone.dropHere;return l.jsx("div",{className:`${hf.dropZone} ${e?hf.active:""} ${n??""}`,"data-droppable":e?"true":void 0,"data-node-id":r,"aria-label":o,role:"region",children:l.jsx("span",{children:o})})},Bl=["identifier","name","mimeType","contentType","primaryCategory","appIcon","channel","organisation","pkgVersion"];async function pf(e){var a;const t={status:["Live"],...e.filters??{}};e.channel&&(t.channel=e.channel);const n=((a=(await Ue.post("/action/composite/v3/search",{request:{filters:t,query:e.query??"",limit:e.limit??20,offset:e.offset??0,sort_by:e.sortBy??{lastUpdatedOn:"desc"},fields:e.fields??Bl}},{headers:{"X-Source":"web","X-msgid":Math.random().toString(36).slice(2)}})).data)==null?void 0:a.result)??{},s=new Set(["count","facets"]);return{content:Object.entries(n).filter(([i])=>!s.has(i)).flatMap(([,i])=>Array.isArray(i)?i:[]),count:n.count??0}}async function mf(e,t){var s,o;const r=t!=null&&t.length?`?fields=${t.join(",")}`:"";return(o=(s=(await Ue.get(`/action/content/v3/read/${e}${r}`)).data)==null?void 0:s.result)==null?void 0:o.content}const gf="application/vnd.sunbird.question";function vf(e){return{cardinality:"single",type:"integer",defaultValue:e.maxScore??1}}function ig(e,t,r){if(!e)return null;if(e.identifier===t)return{question:e,parent:r};for(const n of e.children??[]){const s=ig(n,t,e);if(s)return s}return null}function OF(e,t){const r=ig(e,t);if(!r)return null;const{question:n,parent:s}=r,o={...e,children:[n],childNodes:[t],shuffle:s==null?void 0:s.shuffle,showSolutions:(s==null?void 0:s.showSolutions)??"No",showFeedback:(s==null?void 0:s.showFeedback)??"No"};return(s==null?void 0:s.shuffle)===!0?o.maxScore=1:n.qType==="SA"?delete o.maxScore:n.maxScore!=null&&(o.maxScore=n.maxScore),o}function NF(e,t){const r=((t==null?void 0:t.enabled)??!0)&&!!e;return zr({queryKey:["quml","questionset",e],enabled:r,queryFn:async()=>{const n=await hp(e),s=d=>{if(!d)return[];const f=d.mimeType===gf&&d.identifier?[d.identifier]:[],m=(d.children??[]).flatMap(s);return[...f,...m]},o=s(n),a=new Map;o.length&&(await u0(o)).forEach(f=>{const m=f.identifier;m&&a.set(m,f)});const i=d=>{if(!d)return d;if(d.mimeType===gf&&d.identifier){const f=a.get(d.identifier)??d,m=f.outcomeDeclaration;return m!=null&&m.maxScore||(f.outcomeDeclaration={...m??{},maxScore:vf(f)}),f}return Array.isArray(d.children)&&(d.children=d.children.map(f=>i(f))),d},c=i(n),u=c.outcomeDeclaration;return u!=null&&u.maxScore||(c.outcomeDeclaration={...u??{},maxScore:vf(c)}),c}})}const yf="/assets/quml-player/sunbird-quml-player.js",RF="/assets/quml-player/styles.css",bf="sunbird-quml-player";function PF(e){const t=e.children??[];return t.length?t.every(n=>n.objectType==="Question")?[e]:t:[]}const bt=class bt{constructor(){Ns(this,"eventHandlers",new WeakMap)}loadScript(){return bt.scriptLoaded||customElements.get(bf)?(bt.scriptLoaded=!0,Promise.resolve()):(bt.scriptLoading||(bt.scriptLoading=new Promise((t,r)=>{const n=document.createElement("script");n.src=yf,n.setAttribute("data-quml-player-script","true"),n.onload=()=>{bt.scriptLoaded=!0,bt.scriptLoading=void 0,t()},n.onerror=()=>{bt.scriptLoading=void 0,r(new Error(`Failed to load QuML player script: ${yf}`))},document.body.appendChild(n)})),bt.scriptLoading)}loadStyles(){if(bt.stylesLoaded||document.querySelector('[data-quml-player-styles="true"]')){bt.stylesLoaded=!0;return}const t=document.createElement("link");t.rel="stylesheet",t.href=RF,t.setAttribute("data-quml-player-styles","true"),document.head.appendChild(t),bt.stylesLoaded=!0}static unloadStyles(){var t;(t=document.querySelector('[data-quml-player-styles="true"]'))==null||t.remove(),bt.stylesLoaded=!1}async createConfig(t,r,n){var o,a,i;return await this.loadScript(),{context:{mode:(n==null?void 0:n.mode)??"play",host:"",pdata:{id:((o=r==null?void 0:r.pdata)==null?void 0:o.id)??"sunbird.portal",ver:((a=r==null?void 0:r.pdata)==null?void 0:a.ver)??"1.0",pid:((i=r==null?void 0:r.pdata)==null?void 0:i.pid)??"sunbird-portal"},contentId:t.identifier??"",sid:(r==null?void 0:r.sid)??"",uid:(r==null?void 0:r.uid)??(r==null?void 0:r.userId)??"",channel:(r==null?void 0:r.channel)??"",did:(r==null?void 0:r.did)??"",tags:(r==null?void 0:r.tags)??[],contextRollup:(n==null?void 0:n.contextRollup)??(r==null?void 0:r.rollup)??{},objectRollup:(n==null?void 0:n.objectRollup)??{},...n!=null&&n.cdata?{cdata:n.cdata}:{}},config:{language:"en"},data:{sections:PF(t),identifier:t.identifier??""},metadata:t}}createElement(t){this.loadStyles();const r=document.createElement(bf);return r.setAttribute("player-config",JSON.stringify(t)),r.setAttribute("data-player-id",t.metadata.identifier??"quml"),r}attachEventListeners(t,r,n){this.removeEventListeners(t);const s=a=>r==null?void 0:r(a),o=a=>n==null?void 0:n(a.detail);t.addEventListener("playerEvent",s),t.addEventListener("telemetryEvent",o),this.eventHandlers.set(t,{player:s,telemetry:o})}removeEventListeners(t){const r=this.eventHandlers.get(t);r&&(t.removeEventListener("playerEvent",r.player),t.removeEventListener("telemetryEvent",r.telemetry),this.eventHandlers.delete(t))}};Ns(bt,"scriptLoaded",!1),Ns(bt,"scriptLoading"),Ns(bt,"stylesLoaded",!1);let Aa=bt;const zo=new Aa,FF="_contentPlayerRoot_r6xk8_1",MF="_flowLayout_r6xk8_9",BF="_stage_r6xk8_13",qF="_aspectRatio_r6xk8_16",$F="_playerHeader_r6xk8_32",UF="_playerHeaderThumb_r6xk8_46",VF="_playerHeaderTitle_r6xk8_56",HF="_typeBadge_r6xk8_66",zF="_typeDot_r6xk8_105",QF="_playerFrame_r6xk8_125",WF="_coverOverlay_r6xk8_133",GF="_coverHidden_r6xk8_145",KF="_coverThumb_r6xk8_150",YF="_coverPlayRing_r6xk8_159",ZF="_coverPlayIcon_r6xk8_172",XF="_coverLabel_r6xk8_181",JF="_coverSkeleton_r6xk8_187",eM="_playerWrapper_r6xk8_213",tM="_infoStrip_r6xk8_223",rM="_infoChip_r6xk8_239",nM="_infoChipLabel_r6xk8_258",sM="_infoChipIcon_r6xk8_267",oM="_playerError_r6xk8_273",aM="_playerErrorIcon_r6xk8_287",iM="_playerErrorMsg_r6xk8_292",lM="_qumlRoot_r6xk8_299",Ye={contentPlayerRoot:FF,flowLayout:MF,stage:BF,aspectRatio:qF,playerHeader:$F,playerHeaderThumb:UF,playerHeaderTitle:VF,typeBadge:HF,typeDot:zF,playerFrame:QF,coverOverlay:WF,coverHidden:GF,coverThumb:KF,coverPlayRing:YF,coverPlayIcon:ZF,coverLabel:XF,coverSkeleton:JF,playerWrapper:eM,infoStrip:tM,infoChip:rM,infoChipLabel:nM,infoChipIcon:sM,playerError:oM,playerErrorIcon:aM,playerErrorMsg:iM,qumlRoot:lM},cM="application/vnd.sunbird.questionset",uM="application/vnd.ekstep.ecml-archive";function dM(e,t){const r=new Map,n=o=>{for(const a of o)r.set(a.id,a),a.children&&n(a.children)};n(e);let s=r.get(t);for(;s;){if(s.mimeType===cM)return s.identifier;s=s.parent?r.get(s.parent):void 0}return null}const fM=[{key:"video",mimes:["video/mp4","video/webm","video/ogg"]},{key:"audio",mimes:["audio/mp3","audio/mpeg","audio/ogg","audio/wav"]},{key:"pdf",mimes:["application/pdf"]},{key:"epub",mimes:["application/epub"]},{key:"ecml",mimes:["application/vnd.ekstep.ecml-archive"]},{key:"h5p",mimes:["application/vnd.ekstep.h5p-archive"]},{key:"scorm",mimes:["application/vnd.ekstep.content-collection"]}];function hM(e){return fM.find(t=>t.mimes.includes(e))??{key:"other"}}function pM(e,t){switch(e){case"video":return t.contentPlayer.mimeLabelVideo;case"audio":return t.contentPlayer.mimeLabelAudio;case"pdf":return t.contentPlayer.mimeLabelPdf;case"epub":return t.contentPlayer.mimeLabelEpub;case"ecml":return t.contentPlayer.mimeLabelEcml;case"h5p":return t.contentPlayer.mimeLabelH5p;case"scorm":return t.contentPlayer.mimeLabelScorm;default:return t.contentPlayer.mimeLabelOther}}const mM={"pdf-player":["application/pdf"],"video-player":["video/mp4","video/webm"],"epub-player":["application/epub"]},gM={"pdf-player":"/assets/sunbird-pdf-player.js","video-player":"/assets/sunbird-video-player.js","epub-player":"/assets/sunbird-epub-player.js"},vM={"pdf-player":"sunbird-pdf-player","video-player":"sunbird-video-player","epub-player":"sunbird-epub-player"},yM="/content/preview/preview.html?webview=true&build_number=2.8.0.e552fcd";function $i(e){for(const[t,r]of Object.entries(mM))if(r.includes(e))return t;return"default-player"}function bM(e,t,r){var o;const n=r==null?void 0:r.context,s=t.mimeType??e.mimeType??"";return{context:{mode:"play",partner:[],pdata:{id:((o=n==null?void 0:n.pdata)==null?void 0:o.id)??"sunbird.portal",ver:1,pid:"sunbird-portal"},contentId:e.identifier,sid:(n==null?void 0:n.sid)??"",uid:(n==null?void 0:n.uid)??"",channel:(n==null?void 0:n.channel)??"",did:(n==null?void 0:n.did)??"",timeDiff:0,contextRollup:{},tags:[],app:[(n==null?void 0:n.channel)??""],dims:""},config:{showEndPage:!1,showStartPage:!0,host:"",overlay:{showUser:!1},splash:{text:"",icon:"",bgImage:"",webLink:""},sideMenu:{showDownload:!0,showExit:!1,showShare:!0},apislug:"/action",repos:["/content-plugins/renderer"],plugins:[{id:"org.sunbird.iframeEvent",ver:1,type:"plugin"},{id:"org.sunbird.player.endpage",ver:1.1,type:"plugin"}],enableTelemetryValidation:!1},metadata:t,data:s==="application/vnd.ekstep.ecml-archive"?t.body??{}:{}}}function CM(e){return document.querySelector(`script[src="${e}"]`)?Promise.resolve():new Promise((t,r)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(n)})}async function SM(e,t,r=100){await CM(gM[t]??""),!customElements.get(e)&&await new Promise((n,s)=>{let o=0;const a=setInterval(()=>{o++,customElements.get(e)?(clearInterval(a),n()):o>=r&&(clearInterval(a),s(new Error(`Custom element <${e}> did not register`)))},100)})}const xM=[{key:"author",icon:tC},{key:"license",icon:Wb},{key:"language",icon:Mb},{key:"gradeLevel",icon:Gb},{key:"subject",icon:Fr},{key:"contentType",icon:Jb}];function _M(e,t){switch(e){case"author":return t.contentPlayer.infoFieldAuthor;case"license":return t.contentPlayer.infoFieldLicense;case"language":return t.contentPlayer.infoFieldLanguage;case"gradeLevel":return t.contentPlayer.infoFieldClass;case"subject":return t.contentPlayer.infoFieldSubject;case"contentType":return t.contentPlayer.infoFieldType;default:return e}}function wM({node:e}){const t=fe(),r=e.metadata??{},n=xM.flatMap(s=>{const o=r[s.key];if(!o)return[];const a=Array.isArray(o)?o.join(", "):String(o);return a?[{...s,label:_M(s.key,t),val:a}]:[]});return n.length?l.jsx("div",{className:Ye.infoStrip,children:n.map(s=>l.jsxs("div",{className:Ye.infoChip,children:[s.icon&&l.jsx(s.icon,{size:13,className:Ye.infoChipIcon}),l.jsx("span",{className:Ye.infoChipLabel,children:s.label}),s.val]},s.key))}):null}function lg({node:e,hidden:t}){var s;const r=fe(),n=e.appIcon??((s=e.metadata)==null?void 0:s.appIcon);return l.jsx("div",{className:`${Ye.coverOverlay} ${t?Ye.coverHidden:""}`,children:n?l.jsxs(l.Fragment,{children:[l.jsx("img",{src:n,alt:e.name,className:Ye.coverThumb}),l.jsx("div",{className:Ye.coverPlayRing,children:l.jsx("div",{className:Ye.coverPlayIcon})}),l.jsx("span",{className:Ye.coverLabel,children:r.contentPlayer.loadingPreview})]}):l.jsx("div",{className:Ye.coverSkeleton})})}function cg({message:e}){return l.jsxs("div",{className:Ye.playerError,children:[l.jsx(eC,{size:28,className:Ye.playerErrorIcon}),l.jsx("span",{className:Ye.playerErrorMsg,children:e})]})}function TM({mimeType:e}){const t=fe(),r=hM(e);return l.jsxs("span",{className:Ye.typeBadge,"data-type":r.key,children:[l.jsx("span",{className:Ye.typeDot}),pM(r.key,t)]})}const ql=({node:e,editorMode:t,type:r,singleQuestion:n,layout:s="fill"})=>{var a;if(r==="quml")return l.jsx(kM,{node:e,editorMode:t,singleQuestion:!!n});const o=e.appIcon??((a=e.metadata)==null?void 0:a.appIcon);return l.jsxs("div",{className:`${Ye.contentPlayerRoot} ${s==="flow"?Ye.flowLayout:""}`,children:[l.jsxs("div",{className:Ye.stage,children:[l.jsxs("div",{className:Ye.playerHeader,children:[o&&l.jsx("img",{src:o,alt:"",className:Ye.playerHeaderThumb}),l.jsx("span",{className:Ye.playerHeaderTitle,children:e.name}),l.jsx(TM,{mimeType:e.mimeType??""})]}),l.jsx(EM,{node:e})]}),l.jsx(wM,{node:e})]})};function EM({node:e}){var y;const t=fe(),r=Z(C=>C.editorConfig),[n,s]=g.useState(()=>$i(e.mimeType??"")),[o,a]=g.useState(!1),[i,c]=g.useState(null),[u,d]=g.useState(e.metadata??{}),[f,m]=g.useState(!1),h=g.useRef(null),b=g.useRef(null),p=((y=r==null?void 0:r.config)==null?void 0:y.previewCdnUrl)??yM;g.useEffect(()=>{let C=!1;return m(!1),a(!1),c(null),d(e.metadata??{}),s($i(e.mimeType??"")),mf(e.identifier).then(async S=>{if((S.mimeType??e.mimeType??"")!==uM||S.body)return S;const _=await mf(e.identifier,["body"]).catch(()=>{});return _!=null&&_.body?{...S,body:_.body}:S}).then(S=>{if(C)return;const x={...e.metadata??{},...S};d(x);const _=S.mimeType??e.mimeType??"";s($i(_)),m(!0)}).catch(()=>{C||m(!0)}),()=>{C=!0}},[e.identifier]);const v=bM(e,u,r);return g.useEffect(()=>{if(!f||n!=="default-player")return;const C=h.current;if(!C)return;C.src=p;const S=()=>{try{const _=C.contentWindow;if(typeof(_==null?void 0:_.initializePreview)!="function"){c(t.contentPlayer.previewPlayerUnavailable);return}_.initializePreview(v),setTimeout(()=>a(!0),300)}catch(_){console.error("[ContentPlayer] initializePreview failed",_),c(t.contentPlayer.failedToInitializePlayer)}},x=()=>c(t.contentPlayer.previewPlayerLoadFailed);return C.addEventListener("load",S),C.addEventListener("error",x),()=>{C.removeEventListener("load",S),C.removeEventListener("error",x),C.src=""}},[e.identifier,n,p,f,t]),g.useEffect(()=>{if(!f||n==="default-player")return;const C=b.current;if(!C)return;const S=vM[n];if(!S)return;const x=v;SM(S,n).then(()=>{if(!b.current)return;if(!customElements.get(S)){s("default-player");return}const _=document.createElement(S);_.setAttribute("player-config",JSON.stringify(x)),_.addEventListener("playerEvent",()=>{}),_.addEventListener("telemetryEvent",()=>{}),C.innerHTML="",C.appendChild(_),setTimeout(()=>{try{_.playerConfig=x}catch{}a(!0)},200)}).catch(()=>{console.warn(`[ContentPlayer] ${n} script unavailable, falling back to iframe`),s("default-player")})},[e.identifier,n,f]),l.jsxs("div",{className:Ye.aspectRatio,children:[i?l.jsx(cg,{message:i}):l.jsx(lg,{node:e,hidden:o}),n==="default-player"?l.jsx("iframe",{ref:h,id:"contentPlayer",title:e.name,className:Ye.playerFrame,name:"contentPlayer",allowFullScreen:!0}):l.jsx("div",{ref:b,className:Ye.playerFrame})]})}function kM({node:e,editorMode:t,singleQuestion:r}){const n=fe(),s=Z(h=>h.editorConfig),o=ae(h=>h.treeData),a=g.useRef(null),i=r?dM(o,e.id):e.identifier,{data:c,isLoading:u,error:d}=NF(i??"",{enabled:!!i}),f=g.useMemo(()=>c?r?OF(c,e.identifier):c:null,[c,r,e.identifier]);g.useEffect(()=>{const h=a.current;if(!h||!f)return;let b=null,p=!1;return(async()=>{try{const v=await zo.createConfig(f,s==null?void 0:s.context,{mode:t==="edit"?"edit":"play"});if(p||!a.current)return;const y=zo.createElement(v);b=y,zo.attachEventListeners(y,C=>console.debug("[QumlPlayer] playerEvent",C.detail),C=>console.debug("[QumlPlayer] telemetryEvent",C)),h.innerHTML="",h.appendChild(y)}catch(v){console.error("[QumlPlayer] failed to initialize",v)}})(),()=>{p=!0,b&&(zo.removeEventListeners(b),b.remove()),Aa.unloadStyles()}},[f,s,t,r]);const m=d?`${n.contentPlayer.unableToLoadQuestionset} ${d.message}`:r&&!i?n.contentPlayer.parentQuestionsetNotResolved:r&&c&&!f?n.contentPlayer.questionNotFoundInQuestionset:null;return l.jsxs("div",{className:Ye.qumlRoot,children:[m?l.jsx(cg,{message:m}):u||!f?l.jsx(lg,{node:e,hidden:!1}):null,l.jsx("div",{ref:a,className:Ye.playerWrapper})]})}const AM="_overlay_ifddx_1",LM="_modal_ifddx_11",IM="_header_ifddx_21",DM="_body_ifddx_37",jM="_hint_ifddx_43",OM="_list_ifddx_49",NM="_item_ifddx_55",RM="_selected_ifddx_68",PM="_empty_ifddx_73",FM="_footer_ifddx_79",MM="_cancelBtn_ifddx_87",BM="_moveBtn_ifddx_95",hr={overlay:AM,modal:LM,header:IM,body:DM,hint:jM,list:OM,item:NM,selected:RM,empty:PM,footer:FM,cancelBtn:MM,moveBtn:BM};function qM(e,t,r){const n=[],s=o=>{var a;for(const i of o)i.isFolder&&i.id!==r&&i.id!==t&&n.push(i),(a=i.children)!=null&&a.length&&s(i.children)};return s(e),n}const $M=({resourceId:e,resourceName:t,currentUnitId:r,onClose:n})=>{var f;const s=fe(),{treeData:o,moveNode:a}=ae(),i=qM(o,((f=o[0])==null?void 0:f.id)??"",r),[c,u]=g.useState(null),d=()=>{c&&(a(e,r,c),n())};return l.jsx("div",{className:hr.overlay,role:"dialog","aria-label":s.resourceReorderDialog.dialogAriaLabel,children:l.jsxs("div",{className:hr.modal,children:[l.jsxs("div",{className:hr.header,children:[l.jsxs("span",{children:[s.resourceReorderDialog.moveHeaderPrefix,' "',t,'"']}),l.jsx("button",{onClick:n,"aria-label":s.resourceReorderDialog.closeAriaLabel,children:l.jsx(Mr,{size:16})})]}),l.jsxs("div",{className:hr.body,children:[l.jsx("p",{className:hr.hint,children:s.resourceReorderDialog.selectUnitHint}),l.jsxs("ul",{className:hr.list,children:[i.map(m=>l.jsxs("li",{className:`${hr.item} ${c===m.id?hr.selected:""}`,onClick:()=>u(m.id),children:[l.jsx(Fb,{size:14}),l.jsx("span",{children:m.name})]},m.id)),i.length===0&&l.jsx("li",{className:hr.empty,children:s.resourceReorderDialog.noUnitsAvailable})]})]}),l.jsxs("div",{className:hr.footer,children:[l.jsx("button",{className:hr.cancelBtn,onClick:n,children:s.resourceReorderDialog.cancelButton}),l.jsx("button",{className:hr.moveBtn,onClick:d,disabled:!c,children:s.resourceReorderDialog.moveButton})]})]})})},UM="_overlay_16at9_1",VM="_modal_16at9_11",HM="_header_16at9_21",zM="_body_16at9_37",QM="_table_16at9_43",WM="_pageInput_16at9_61",GM="_empty_16at9_68",KM="_footer_16at9_74",YM="_cancelBtn_16at9_82",ZM="_saveBtn_16at9_90",Dr={overlay:UM,modal:VM,header:HM,body:zM,table:QM,pageInput:WM,empty:GM,footer:KM,cancelBtn:YM,saveBtn:ZM};function XM(e){const t=[],r=n=>{var s;for(const o of n)!o.isFolder&&(!o.children||o.children.length===0)?t.push(o):(s=o.children)!=null&&s.length&&r(o.children)};return r(e),t}const JM=({onClose:e})=>{const t=fe(),{treeData:r,updateNode:n}=ae(),s=XM(r),[o,a]=g.useState(()=>Object.fromEntries(s.map(c=>{var u;return[c.id,String(((u=c.metadata)==null?void 0:u.pageNumber)??"")]}))),i=g.useCallback(()=>{for(const[c,u]of Object.entries(o))u!==""&&n(c,{pageNumber:parseInt(u,10)||void 0});e()},[o,n,e]);return l.jsx("div",{className:Dr.overlay,role:"dialog","aria-label":t.assignPageNumber.dialogAriaLabel,children:l.jsxs("div",{className:Dr.modal,children:[l.jsxs("div",{className:Dr.header,children:[l.jsx("span",{children:t.assignPageNumber.title}),l.jsx("button",{onClick:e,"aria-label":t.assignPageNumber.closeAriaLabel,children:l.jsx(Mr,{size:16})})]}),l.jsx("div",{className:Dr.body,children:s.length===0?l.jsx("p",{className:Dr.empty,children:t.assignPageNumber.emptyState}):l.jsxs("table",{className:Dr.table,children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:t.assignPageNumber.contentColumnHeader}),l.jsx("th",{children:t.assignPageNumber.pageNumberColumnHeader})]})}),l.jsx("tbody",{children:s.map(c=>l.jsxs("tr",{children:[l.jsx("td",{children:c.name}),l.jsx("td",{children:l.jsx("input",{type:"number",min:1,value:o[c.id]??"",onChange:u=>a(d=>({...d,[c.id]:u.target.value})),className:Dr.pageInput})})]},c.id))})]})}),l.jsxs("div",{className:Dr.footer,children:[l.jsx("button",{className:Dr.cancelBtn,onClick:e,children:t.assignPageNumber.cancelButton}),l.jsxs("button",{className:Dr.saveBtn,onClick:i,children:[l.jsx(Qb,{size:14})," ",t.assignPageNumber.saveButton]})]})]})})},e2="_container_1a7t2_1",t2="_panelHeader_1a7t2_10",r2="_panelHeaderLeft_1a7t2_19",n2="_panelCollapseBtn_1a7t2_27",s2="_titleRow_1a7t2_46",o2="_field_1a7t2_47",a2="_moveBtn_1a7t2_64",i2="_icon_1a7t2_84",l2="_nameInput_1a7t2_93",c2="_fieldHeader_1a7t2_118",u2="_label_1a7t2_124",d2="_fieldCount_1a7t2_133",f2="_chips_1a7t2_170",h2="_chip_1a7t2_170",p2="_chipRemove_1a7t2_188",m2="_keywordInput_1a7t2_202",g2="_input_1a7t2_207",v2="_addBtn_1a7t2_220",y2="_radioGroup_1a7t2_234",b2="_radioLabel_1a7t2_239",tt={container:e2,panelHeader:t2,panelHeaderLeft:r2,panelCollapseBtn:n2,titleRow:s2,field:o2,moveBtn:a2,icon:i2,nameInput:l2,fieldHeader:c2,label:u2,fieldCount:d2,chips:f2,chip:h2,chipRemove:p2,keywordInput:m2,input:g2,addBtn:v2,radioGroup:y2,radioLabel:b2},C2=({node:e,editorMode:t,onMoveClick:r,reorderDialog:n})=>{var R,P;const{updateNode:s,markDirty:o}=ae(),a=t==="edit",i=Ao(e),c=fe(),u=Z(O=>O.relationalFormConfig),d=O=>u==null?void 0:u.find(V=>V.code===O),f=O=>!u||!!d(O),m=(O,V)=>{var ne;return((ne=d(O))==null?void 0:ne.label)||V},[h,b]=g.useState(!0),p=((R=e.metadata)==null?void 0:R.relationalMetadata)??{},[v,y]=g.useState(p.name??e.name??""),[C,S]=g.useState(""),[x,_]=g.useState(Array.isArray(p.keywords)?p.keywords:Array.isArray((P=e.metadata)==null?void 0:P.keywords)?e.metadata.keywords:[]),[w,E]=g.useState(!!p.optional);g.useEffect(()=>{var V,ne;const O=((V=e.metadata)==null?void 0:V.relationalMetadata)??{};y(O.name??e.name??""),_(Array.isArray(O.keywords)?O.keywords:Array.isArray((ne=e.metadata)==null?void 0:ne.keywords)?e.metadata.keywords:[]),E(!!O.optional)},[e.id]);const k=()=>{v.trim()&&v!==e.name&&(s(e.id,{name:v.trim()}),o())},N=()=>{const O=C.trim();if(O&&!x.includes(O)){const V=[...x,O];_(V),s(e.id,{keywords:V}),o()}S("")},F=O=>{const V=x.filter(ne=>ne!==O);_(V),s(e.id,{keywords:V}),o()},I=O=>{E(O),s(e.id,{optional:O}),o()};return l.jsxs("div",{className:tt.container,children:[l.jsxs("div",{className:tt.panelHeader,children:[l.jsxs("div",{className:tt.panelHeaderLeft,children:[l.jsx("span",{className:`sbx-ct-badge--${i.key}`,children:i.label}),a&&l.jsx("button",{type:"button",className:tt.moveBtn,onClick:r,children:c.contentEditForm.moveToAnotherUnitButton})]}),l.jsx("button",{type:"button",className:tt.panelCollapseBtn,onClick:()=>b(O=>!O),"aria-expanded":h,"aria-label":h?c.contentEditForm.collapseMetadataPanelAriaLabel:c.contentEditForm.expandMetadataPanelAriaLabel,title:h?c.contentEditForm.collapseTitle:c.contentEditForm.expandTitle,children:h?l.jsx(bn,{size:15}):l.jsx(jb,{size:15})})]}),h&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:tt.titleRow,children:[e.appIcon&&l.jsx("img",{src:e.appIcon,alt:c.contentEditForm.iconAlt,className:tt.icon}),l.jsx("input",{type:"text",className:tt.nameInput,value:v,disabled:!a,onChange:O=>y(O.target.value),onBlur:k,placeholder:c.contentEditForm.contentNamePlaceholder})]}),f("keywords")&&l.jsxs("div",{className:tt.field,children:[l.jsx("div",{className:tt.fieldHeader,children:l.jsxs("label",{className:tt.label,children:[m("keywords",c.contentEditForm.keywordsLabel),x.length>0&&l.jsx("span",{className:tt.fieldCount,children:x.length})]})}),x.length>0&&l.jsx("div",{className:tt.chips,children:x.map(O=>l.jsxs("span",{className:tt.chip,children:[O,a&&l.jsx("button",{type:"button",className:tt.chipRemove,onClick:()=>F(O),children:"×"})]},O))}),a&&l.jsxs("div",{className:tt.keywordInput,children:[l.jsx("input",{type:"text",className:tt.input,value:C,placeholder:c.contentEditForm.addKeywordPlaceholder,onChange:O=>S(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),N())}}),l.jsx("button",{type:"button",className:tt.addBtn,onClick:N,children:c.contentEditForm.addButton})]})]}),f("optional")&&l.jsxs("div",{className:tt.field,children:[l.jsx("label",{className:tt.label,children:m("optional",c.contentEditForm.optionalInCollectionLabel)}),l.jsxs("div",{className:tt.radioGroup,children:[l.jsxs("label",{className:tt.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:w===!0,onChange:()=>I(!0),disabled:!a}),c.contentEditForm.yesOption]}),l.jsxs("label",{className:tt.radioLabel,children:[l.jsx("input",{type:"radio",name:`optional-${e.id}`,checked:w===!1,onChange:()=>I(!1),disabled:!a}),c.contentEditForm.noOption]})]})]})]}),n]})},S2="_iconBtn_64kgu_1",x2="_editable_64kgu_14",_2="_iconImg_64kgu_26",w2="_placeholder_64kgu_34",T2="_removeBtn_64kgu_41",Us={iconBtn:S2,editable:x2,iconImg:_2,placeholder:w2,removeBtn:T2},E2=({nodeId:e,value:t,editable:r})=>{const[n,s]=g.useState(!1),{updateNode:o,markDirty:a}=ae(),i=fe(),c=d=>{o(e,{appIcon:d}),a(),s(!1)},u=d=>{d.stopPropagation(),o(e,{appIcon:""}),a()};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:[Us.iconBtn,r?Us.editable:""].filter(Boolean).join(" "),role:r?"button":void 0,tabIndex:r?0:-1,"aria-label":r?i.titleAppIcon.selectAppIconAriaLabel:i.titleAppIcon.appIconAriaLabel,onClick:()=>r&&s(!0),onKeyDown:d=>{r&&(d.key==="Enter"||d.key===" ")&&s(!0)},children:[t?l.jsx("img",{src:t,alt:i.titleAppIcon.appIconAlt,className:Us.iconImg}):l.jsx("div",{className:Us.placeholder,children:l.jsx(Ph,{size:24})}),t&&r&&l.jsx("button",{type:"button",className:Us.removeBtn,onClick:u,"aria-label":i.titleAppIcon.removeIconAriaLabel,children:l.jsx(ks,{size:11})})]}),n&&l.jsx(Jm,{nodeId:e,currentValue:t,onSelect:c,onClose:()=>s(!1)})]})},k2="_courseDetails_pkcf3_1",A2="_courseDetailsLoading_pkcf3_7",L2="_courseDetailsError_pkcf3_7",I2="_detailsCard_pkcf3_12",D2="_unitsCard_pkcf3_12",j2="_cardTitle_pkcf3_22",O2="_fieldGroup_pkcf3_29",N2="_fieldGroupLast_pkcf3_33",R2="_fieldLabel_pkcf3_37",P2="_fieldValue_pkcf3_47",F2="_fieldValueMultiline_pkcf3_52",M2="_unitsLabel_pkcf3_58",B2="_unitsDescription_pkcf3_68",q2="_unitList_pkcf3_74",$2="_unitCard_pkcf3_80",U2="_unitHeader_pkcf3_86",V2="_unitIcon_pkcf3_99",H2="_unitTitle_pkcf3_111",z2="_unitCount_pkcf3_120",Q2="_unitBody_pkcf3_126",W2="_unitDescription_pkcf3_131",G2="_unitKeywords_pkcf3_138",K2="_keywordPill_pkcf3_145",Y2="_unitTopicsRow_pkcf3_155",Z2="_unitContents_pkcf3_167",X2="_contentRow_pkcf3_174",J2="_contentIcon_pkcf3_180",eB="_contentTitle_pkcf3_185",tB="_contentSkills_pkcf3_193",rB="_skillPill_pkcf3_200",Ve={courseDetails:k2,courseDetailsLoading:A2,courseDetailsError:L2,detailsCard:I2,unitsCard:D2,cardTitle:j2,fieldGroup:O2,fieldGroupLast:N2,fieldLabel:R2,fieldValue:P2,fieldValueMultiline:F2,unitsLabel:M2,unitsDescription:B2,unitList:q2,unitCard:$2,unitHeader:U2,unitIcon:V2,unitTitle:H2,unitCount:z2,unitBody:Q2,unitDescription:W2,unitKeywords:G2,keywordPill:K2,unitTopicsRow:Y2,unitContents:Z2,contentRow:X2,contentIcon:J2,contentTitle:eB,contentSkills:tB,skillPill:rB},nB={video:Ha,pdf:So,h5p:$a,scorm:Va,audio:Ua,quiz:qa,course:Fr,default:Cn};function Ui(e){return Array.isArray(e)?e.map(String):e?[String(e)]:[]}const ug=({courseId:e,variant:t="compact",title:r,onLoaded:n})=>{const s=fe(),o=kr(),[a,i]=g.useState(null),[c,u]=g.useState(""),[d,f]=g.useState(null),[m,h]=g.useState({}),b=t==="full";g.useEffect(()=>{let C=!1;return i(null),u(""),f(null),p0(e).then(S=>{if(C)return;const _=(S.children??[]).map(w=>Ka(w));i(_),u(S.description??""),h(Object.fromEntries(_.map(w=>[w.id,!0]))),n==null||n({totalContents:_.reduce((w,E)=>{var k;return w+(((k=E.children)==null?void 0:k.length)??0)},0)})}).catch(()=>{C||f(s.learningPath.courseDetailsError)}),()=>{C=!0}},[e,s.learningPath.courseDetailsError]);const p=C=>h(S=>({...S,[C]:!S[C]})),v=C=>{var S;return o?Ui((S=C.metadata)==null?void 0:S[o.code]).map(x=>Ya(x,o.terms)):[]},y=C=>(C===1?s.learningPath.contentCountLabel:s.learningPath.contentCountLabelPlural).replace("{count}",String(C));return l.jsx("div",{className:Ve.courseDetails,children:d?l.jsx("p",{className:Ve.courseDetailsError,children:d}):a===null?l.jsx("p",{className:Ve.courseDetailsLoading,children:s.learningPath.courseDetailsLoading}):l.jsxs(l.Fragment,{children:[b&&l.jsxs("div",{className:Ve.detailsCard,children:[l.jsx("h3",{className:Ve.cardTitle,children:s.learningPath.courseDetailsCardTitle}),l.jsxs("div",{className:Ve.fieldGroup,children:[l.jsx("span",{className:Ve.fieldLabel,children:s.learningPath.courseTitleFieldLabel}),l.jsx("div",{className:Ve.fieldValue,children:r})]}),l.jsxs("div",{className:Ve.fieldGroupLast,children:[l.jsx("span",{className:Ve.fieldLabel,children:s.learningPath.courseDescriptionFieldLabel}),l.jsx("div",{className:Ve.fieldValueMultiline,children:c||s.learningPath.noCourseDescriptionPlaceholder})]})]}),a.length===0?l.jsx("p",{className:Ve.courseDetailsLoading,children:s.learningPath.courseDetailsEmpty}):l.jsxs("div",{className:b?Ve.unitsCard:void 0,children:[l.jsx("span",{className:Ve.unitsLabel,children:s.learningPath.unitsSectionLabel}),b&&l.jsx("p",{className:Ve.unitsDescription,children:s.learningPath.unitsSectionDescription}),l.jsx("div",{className:Ve.unitList,children:a.map(C=>{var E,k;const S=!!m[C.id],x=(C.children??[]).length,_=Ui((E=C.metadata)==null?void 0:E.keywords),w=Ui((k=C.metadata)==null?void 0:k.topic);return l.jsxs("div",{className:Ve.unitCard,children:[l.jsxs("button",{type:"button",className:Ve.unitHeader,onClick:()=>p(C.id),"aria-expanded":S,children:[S?l.jsx(bn,{size:17}):l.jsx(Ba,{size:17}),l.jsx("span",{className:Ve.unitIcon,children:l.jsx(Rh,{size:16})}),l.jsx("span",{className:Ve.unitTitle,children:C.name}),b&&l.jsx("span",{className:Ve.unitCount,children:y(x)})]}),S&&l.jsxs("div",{className:Ve.unitBody,children:[b&&C.description&&l.jsx("p",{className:Ve.unitDescription,children:C.description}),b&&_.length>0&&l.jsx("div",{className:Ve.unitKeywords,children:_.map(N=>l.jsx("span",{className:Ve.keywordPill,children:N},N))}),b&&w.length>0&&l.jsxs("div",{className:Ve.unitTopicsRow,children:[l.jsx("span",{className:Ve.fieldLabel,children:s.learningPath.unitTopicsFieldLabel}),l.jsx("span",{children:w.join(", ")})]}),l.jsx("div",{className:Ve.unitContents,children:(C.children??[]).map(N=>{const F=Ao(N),I=nB[F.key]??Cn,R=v(N);return l.jsxs("div",{className:Ve.contentRow,children:[l.jsx(I,{size:16,className:Ve.contentIcon}),l.jsx("span",{className:Ve.contentTitle,children:N.name}),R.length>0&&l.jsx("div",{className:Ve.contentSkills,children:R.map(P=>l.jsx("span",{className:Ve.skillPill,children:P},P))})]},N.id)})})]})]},C.id)})})]})]})})},sB="_backToPathButton_1u4o4_1",oB="_assessmentTitle_1u4o4_15",aB="_slotPills_1u4o4_22",iB="_slotPill_1u4o4_22",lB="_slotPillHint_1u4o4_40",cB="_slotPillPurpose_1u4o4_45",uB="_slotPillWarning_1u4o4_51",dB="_slotPillPrimary_1u4o4_56",fB="_courseCard_1u4o4_62",hB="_courseCardHeading_1u4o4_72",pB="_courseCardDescription_1u4o4_79",mB="_courseNotAdded_1u4o4_85",gB="_assessmentExplainer_1u4o4_93",vB="_assessmentExplainerHeading_1u4o4_107",yB="_leafContentLayout_1u4o4_117",bB="_container_1u4o4_131",CB="_emptyState_1u4o4_140",SB="_titleRow_1u4o4_150",xB="_titleRowLp_1u4o4_157",_B="_nodeTitle_1u4o4_171",wB="_nodeTitleLpRoot_1u4o4_193",TB="_nodeTitleSub_1u4o4_198",EB="_courseDetailHeader_1u4o4_203",kB="_courseDetailIcon_1u4o4_210",AB="_courseDetailTitle_1u4o4_222",LB="_courseDetailMeta_1u4o4_229",IB="_formArea_1u4o4_234",DB="_contentListArea_1u4o4_238",jB="_contentListAreaLp_1u4o4_242",OB="_dropZone_1u4o4_246",NB="_reviewComment_1u4o4_253",RB="_reviewCommentLabel_1u4o4_266",PB="_reviewCommentText_1u4o4_272",Re={backToPathButton:sB,assessmentTitle:oB,slotPills:aB,slotPill:iB,slotPillHint:lB,slotPillPurpose:cB,slotPillWarning:uB,slotPillPrimary:dB,courseCard:fB,courseCardHeading:hB,courseCardDescription:pB,courseNotAdded:mB,assessmentExplainer:gB,assessmentExplainerHeading:vB,leafContentLayout:yB,container:bB,emptyState:CB,titleRow:SB,titleRowLp:xB,nodeTitle:_B,nodeTitleLpRoot:wB,nodeTitleSub:TB,courseDetailHeader:EB,courseDetailIcon:kB,courseDetailTitle:AB,courseDetailMeta:LB,formArea:IB,contentListArea:DB,contentListAreaLp:jB,dropZone:OB,reviewComment:NB,reviewCommentLabel:RB,reviewCommentText:PB},FB=({slot:e,isEditable:t})=>{var h;const r=fe(),n=ae(b=>b.treeData),s=ae(b=>b.selectNode),o=(h=n[0])==null?void 0:h.id,{pre:a,post:i}=wc(),c=(e==="pre"?a:i).filled,u=e==="pre"?r.learningPath.priorAssessmentLabel:r.learningPath.outcomeAssessmentLabel,d=e==="pre"?Vr:Ib,f=e==="pre"?r.learningPath.priorAssessmentExplainerTitle:r.learningPath.outcomeAssessmentExplainerTitle,m=e==="pre"?r.learningPath.priorAssessmentExplainerBody:r.learningPath.outcomeAssessmentExplainerBody;return l.jsxs("div",{className:Re.container,children:[l.jsxs("button",{type:"button",className:Re.backToPathButton,onClick:()=>o&&s(o),children:[l.jsx(Zl,{size:14})," ",r.learningPath.backToPathButton]}),l.jsx("div",{className:Re.assessmentTitle,children:u}),l.jsx("div",{className:Re.slotPills,children:e==="pre"?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Re.slotPill} ${Re.slotPillHint}`,children:[l.jsx(uu,{size:12})," ",r.learningPath.priorAssessmentHint]}),l.jsxs("span",{className:`${Re.slotPill} ${Re.slotPillPurpose}`,children:[l.jsx(Ab,{size:12})," ",r.learningPath.priorAssessmentPurposeLabel]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:`${Re.slotPill} ${Re.slotPillWarning}`,children:[l.jsx(Fh,{size:12})," ",r.learningPath.outcomeUnlocksHint]}),l.jsxs("span",{className:`${Re.slotPill} ${Re.slotPillPrimary}`,children:[l.jsx(uu,{size:12})," ",r.learningPath.outcomeAssessmentHint]})]})}),l.jsxs("div",{className:Re.formArea,children:[l.jsxs("div",{className:Re.courseCard,children:[l.jsx("div",{className:Re.courseCardHeading,children:r.learningPath.assessmentCourseSectionTitle}),l.jsx("p",{className:Re.courseCardDescription,children:r.learningPath.assessmentCourseSectionDescription}),c?l.jsx(Ml,{slot:e,isEditable:t}):l.jsx("div",{className:Re.courseNotAdded,children:r.learningPath.assessmentNotAddedYet})]}),l.jsxs("div",{className:Re.assessmentExplainer,children:[l.jsxs("div",{className:Re.assessmentExplainerHeading,children:[l.jsx(d,{size:16}),l.jsx("span",{children:f})]}),l.jsx("p",{children:m})]})]})]})},MB="application/vnd.sunbird.questionset",dg="application/vnd.sunbird.question",BB=[MB,dg];function Cf(e){var t,r;if(!(!e||e.status!=="Draft"||((t=e.metadata)==null?void 0:t.prevStatus)!=="Review"))return(r=e.metadata)==null?void 0:r.rejectComment}const qB=({editorMode:e,onToolbarEvent:t})=>{var ve,me,H,be,Te;const r=fe(),[n,s]=g.useState("details"),[o,a]=g.useState([]),[i,c]=g.useState(null),[u,d]=g.useState(!1),[f,m]=g.useState(null),h=g.useRef(null),b=g.useRef(),{selectedNodeId:p,breadcrumb:v,activeNodeMeta:y,updateNode:C,treeData:S,selectNode:x}=ae(),_=at($=>$.activeAssessmentSlot),w=Z($=>{var B,le,ge,J;return((le=(B=$.editorConfig)==null?void 0:B.context)==null?void 0:le.contentId)??((J=(ge=$.editorConfig)==null?void 0:ge.context)==null?void 0:J.identifier)??""}),E=Z($=>$.editorProfile.competencyScoped),k=p?fg(S,p):null;g.useEffect(()=>{m(null)},[k==null?void 0:k.identifier]);const N=!!k&&!k.parent,F=!!(k!=null&&k.isFolder),I=k&&BB.includes(k.mimeType??""),R=(k==null?void 0:k.mimeType)===dg,P=k&&!k.isFolder&&!I&&!N,V=E&&F&&ot(k??void 0)?((H=(me=(ve=S[0])==null?void 0:ve.children)==null?void 0:me[0])==null?void 0:H.id)===(k==null?void 0:k.id)?"pre":"post":E?_:null,ne=Cf(k)??(N?Cf(S[0]):void 0),W=g.useCallback(()=>{const $=h.current;if(!$||!p)return;const B=$.innerText.trim();clearTimeout(b.current),b.current=setTimeout(()=>{C(p,{name:B})},600)},[p,C]),ue=g.useCallback($=>{t({action:"onFormValueChange",data:$})},[t]),ie=g.useCallback(($,B)=>{a(B),t({action:"onFormStatusChange",data:{isValid:$,nodeId:p}})},[t,p]);if(!k)return l.jsx("div",{className:Re.emptyState,children:l.jsx("p",{children:r.contextualEditor.emptyStateMessage})});if(I)return l.jsx(ql,{node:k,editorMode:e,type:"quml",singleQuestion:R});if(E&&P&&(k.primaryCategory==="Course"||ss(k))){const $=k.parent?x0(((be=S[0])==null?void 0:be.children)??[],k.parent):null,B=($==null?void 0:$.role)==="pre"?r.learningPath.priorAssessmentLabel:($==null?void 0:$.role)==="post"?r.learningPath.outcomeAssessmentLabel:($==null?void 0:$.role)==="level"?r.learningPath.levelNumberPrefix.replace("{n}",String($.levelNumber)):null,le=f===null?"":` · ${(f===1?r.learningPath.contentCountLabel:r.learningPath.contentCountLabelPlural).replace("{count}",String(f))}`;return l.jsxs("div",{className:Re.container,children:[l.jsxs("button",{type:"button",className:Re.backToPathButton,onClick:()=>k.parent&&x(k.parent),children:[l.jsx(Zl,{size:14}),B?r.learningPath.backToLevelButton.replace("{label}",B):r.learningPath.backToPathButton]}),l.jsxs("div",{className:Re.courseDetailHeader,children:[l.jsx("span",{className:Re.courseDetailIcon,children:l.jsx(Fr,{size:26})}),l.jsxs("div",{children:[l.jsx("h2",{className:Re.courseDetailTitle,children:k.name}),l.jsxs("span",{className:Re.courseDetailMeta,children:[k.primaryCategory,le]})]})]}),l.jsx(ug,{courseId:k.identifier,variant:"full",title:k.name,onLoaded:({totalContents:ge})=>m(ge)},k.identifier)]})}return V?l.jsx(FB,{slot:V,isEditable:e==="edit"}):P?l.jsxs("div",{className:Re.leafContentLayout,children:[l.jsx(ql,{node:k,editorMode:e,type:"content",layout:"flow"}),l.jsx(C2,{node:k,editorMode:e,onMoveClick:()=>c(k.identifier),reorderDialog:i?l.jsx($M,{resourceId:i,resourceName:k.name,currentUnitId:k.parent??"",onClose:()=>c(null)}):null})]}):l.jsxs("div",{className:Re.container,children:[l.jsx(lO,{crumbs:v}),ne&&l.jsxs("div",{className:Re.reviewComment,role:"alert",children:[l.jsx("span",{className:Re.reviewCommentLabel,children:r.contextualEditor.reviewCommentLabel}),l.jsx("span",{className:Re.reviewCommentText,children:ne})]}),l.jsxs("div",{className:[Re.titleRow,E?Re.titleRowLp:""].filter(Boolean).join(" "),children:[N&&p&&l.jsx(E2,{nodeId:p,value:String(k.appIcon??((Te=k.metadata)==null?void 0:Te.appIcon)??""),editable:e==="edit"}),l.jsx("div",{ref:h,className:[Re.nodeTitle,E&&N?Re.nodeTitleLpRoot:"",E&&!N?Re.nodeTitleSub:""].filter(Boolean).join(" "),contentEditable:e==="edit",suppressContentEditableWarning:!0,onInput:W,onBlur:W,"data-placeholder":r.contextualEditor.untitledPlaceholder,"aria-label":r.contextualEditor.nodeTitleAriaLabel,children:k.name})]}),l.jsx(pO,{activeTab:n,onChange:$=>s($),errorTabs:o,visibleTabs:N&&!E?void 0:["details"]}),l.jsx("div",{className:Re.formArea,children:l.jsx(mP,{nodeMetadata:y,activeTab:n,isRoot:N,isFolder:F,editorMode:e,onFormValueChange:ue,onFormStatusChange:ie},`${p??"none"}:${N?"root":"node"}`)}),(F||N)&&n==="details"&&l.jsx("div",{className:[Re.contentListArea,E?Re.contentListAreaLp:""].filter(Boolean).join(" "),children:l.jsx(LF,{editorMode:e,isRoot:N})}),l.jsx(jF,{isActive:!1,label:r.contextualEditor.dropZoneLabel,nodeId:p??void 0,className:Re.dropZone}),u&&l.jsx(JM,{contentId:w,onClose:()=>d(!1)})]})};function fg(e,t){for(const r of e){if(r.id===t)return r;if(r.children){const n=fg(r.children,t);if(n)return n}}}const hg=xo((e,t)=>({allContent:[],filteredContent:[],searchQuery:"",activeFilter:"all",advancedFilters:{},isLoading:!1,totalCount:0,offset:0,sortAZ:!1,setContent:(r,n)=>{e({allContent:r,totalCount:n,offset:r.length}),t().applyFilter()},appendContent:(r,n)=>{const o=[...t().allContent,...r];e({allContent:o,totalCount:n,offset:o.length}),t().applyFilter()},setFilter:r=>{e({activeFilter:r}),t().applyFilter()},setSearch:r=>{e({searchQuery:r}),t().applyFilter()},setLoading:r=>e({isLoading:r}),setAdvancedFilters:r=>e({advancedFilters:r}),setOffset:r=>e({offset:r}),setSortAZ:r=>e({sortAZ:r}),applyFilter:()=>{const{allContent:r,activeFilter:n,searchQuery:s}=t();let o=r;if(n&&n!=="all"){const a=n.toLowerCase();o=o.filter(i=>[i.mimeType??"",i.primaryCategory??"",i.contentType??""].join(" ").toLowerCase().includes(a))}if(s&&s.trim()!==""){const a=s.toLowerCase().trim();o=o.filter(i=>(i.name??"").toLowerCase().includes(a))}e({filteredContent:o})}})),$B=[],UB=[],Sf={isCourse:!1,frameworkId:void 0,skillField:void 0,skills:$B,terms:UB,ready:!1};function VB(e,t){return e?{...e.metadata??{},...t[e.id]??{}}:{}}function HB(e,t,r){return e==="learningPath"?!1:(t.primaryCategory??r)==="Course"}function zB(e,t,r){if(!e)return Sf;const{usableFrameworkId:n,skillField:s,terms:o}=r;if(!n||!s)return{...Sf,isCourse:!0};const a=Cs(t,s,o);return{isCourse:!0,frameworkId:n,skillField:s,skills:a,terms:o,ready:a.length>0}}function Nc(){const e=Z(m=>m.editorProfile.key),t=Z(m=>{var h,b;return(b=(h=m.editorConfig)==null?void 0:h.config)==null?void 0:b.primaryCategory}),r=ae(m=>m.treeData[0]),n=ae(m=>m.treeCache),s=g.useMemo(()=>VB(r,n),[r,n]),o=HB(e,s,t),a=o?Za(r,n):void 0,{usableFrameworkId:i,skillField:c,terms:u}=hc(a),d=zB(o,s,{usableFrameworkId:i,skillField:c,terms:u}),f=d.skills.join("|");return g.useMemo(()=>d,[d.isCourse,d.ready,d.frameworkId,d.skillField,f,d.terms])}function QB(e,t,r,n){return{[ir]:[e],[t]:{subsetOf:xa(r,n)}}}function WB(e,t,r,n){if(e[ir]!==t)return!1;const s=e[r],o=Array.isArray(s)?s:s==null?[]:[s];if(o.length===0)return!1;const a=new Set(n);return o.every(i=>a.has(String(i)))}function GB(e,t){return e<t}function KB(e){return e.isCourse&&!e.ready?"pickSkills":null}function YB(e,t,r,n,s,o){const a={primaryCategory:[t?uc:"Course"]};if(o){if(a[ir]=[o.frameworkId],e&&o.roleSkillValues.length&&n)return a[n]=o.roleSkillValues,a}else s&&(a.framework=[s]);return!e&&r.length&&n&&(a[n]={subsetOf:r}),a}function xf(e,t,r){if(!e&&r)return[...Bl,r,ir];if(!(!e||!t))return[...Bl,t,"framework",ir]}function ZB(e,t,r=!1){return!e||r||t?null:"noCurriculum"}function XB(e){return e.source==="manual"?[]:e.scope}function JB(e,t,r){return e?{frameworkId:e,roleSkillValues:xa(t,r)}:void 0}function eq(e,t,r){return{content:r===0?t:[...e,...t.filter(s=>!e.some(o=>o.identifier===s.identifier))],nextOffset:r+t.length}}function _f(){let e=0;return{next:()=>++e,isLatest:t=>t===e,invalidate:()=>{e+=1}}}const wf=20,Tf=[];function pg(){var d;const e=Z(f=>f.editorConfig),t=Z(f=>f.editorProfile),r=ae(f=>f.selectedNodeId),n=ae(f=>f.treeData);if(t.restrictedContentCategories)return t.restrictedContentCategories;const s=g.useCallback(()=>{if(!r||!n.length)return 0;function f(m,h,b=0){var p;for(const v of m){if(v.id===h)return b;if((p=v.children)!=null&&p.length){const y=f(v.children,h,b+1);if(y>=0)return y}}return-1}return Math.max(0,f(n,r))},[r,n])(),o=(d=e==null?void 0:e.config)==null?void 0:d.hierarchy;if(!o)return[...Hd];const a=`level${s}`,i=o[a],c=i==null?void 0:i.children,u=c==null?void 0:c.Content;return u!=null&&u.length?u:[...Hd]}function tq(){const e=hg(),t=Z(J=>{var de,X;return((X=(de=J.editorConfig)==null?void 0:de.context)==null?void 0:X.channel)??""}),r=pg(),n=Z(J=>J.editorProfile),s=at(J=>J.activeAssessmentSlot),o=at(J=>J.activeLevelExamTarget),a=ae(J=>J.treeData),i=ae(J=>J.treeCache),c=kr(),u=n.competencyScoped?wp(a[0],i):void 0,d=g.useRef(),f=Kr(),m=n.competencyScoped?JB(f.frameworkId,f.roleSkills,f.terms):void 0,h=Nc(),b=h.ready,[p,v]=g.useState(Tf),y=g.useRef(p);y.current=p;const[C,S]=g.useState(0),[x,_]=g.useState(0),[w,E]=g.useState(0),[k,N]=g.useState(!1),F=g.useRef(null),I=g.useRef(_f()).current,R=g.useRef(_f()).current,P=()=>{I.invalidate(),F.current=null,v(Tf),S(0),_(0),E(0),N(!1)},O=async(J,de)=>{const X=I.next();N(!0);try{const{content:Ce,count:Ne}=await pf({filters:J.filters,query:J.query,limit:wf,offset:de,channel:t||void 0,sortBy:J.sortBy,fields:J.fields});if(!I.isLatest(X))return;const re=eq(y.current,Ce.filter(ce=>!J.isMatch(ce)),de);v(re.content),_(de+Ce.length),S(Math.max(0,Ne-J.matchedCount)),E(Ne)}catch(Ce){console.error("[useLibrary] other content load error:",Ce)}finally{I.isLatest(X)&&N(!1)}},V=!!s||!!o,ne=Is(),W=XB(ne),ue=ZB(n.competencyScoped,(m==null?void 0:m.frameworkId)??u,V),ie=g.useCallback(async(J="",de="all",X={},Ce=!0,Ne=!1)=>{var ce,G,U,Ee,we;const re=R.next();e.setLoading(!0);try{if(ue){e.setContent([],0),P();return}let ke;if(n.competencyScoped){const T=YB(s,V,xa(W,c==null?void 0:c.terms),c==null?void 0:c.code,u,m);ke={status:["Live"],...T}}else ke={status:["Live"],primaryCategory:de&&de!=="all"?[de]:r},(ce=X==null?void 0:X.board)!=null&&ce.length&&(ke.board=X.board),(G=X==null?void 0:X.medium)!=null&&G.length&&(ke.medium=X.medium),(U=X==null?void 0:X.gradeLevel)!=null&&U.length&&(ke.gradeLevel=X.gradeLevel),(Ee=X==null?void 0:X.subject)!=null&&Ee.length&&(ke.subject=X.subject),(we=X==null?void 0:X.primaryCategory)!=null&&we.length&&(ke.primaryCategory=X.primaryCategory);const xe={...ke},Pe=b&&h.frameworkId&&h.skillField?QB(h.frameworkId,h.skillField,h.skills,h.terms):void 0;Pe&&Object.assign(ke,Pe);const qt=Ne?{name:"asc"}:{lastUpdatedOn:"desc"},lr=Ce?0:e.offset,{content:$t,count:Lt}=await pf({filters:ke,query:J,limit:J?50:wf,offset:lr,channel:t||void 0,sortBy:qt,fields:xf(n.competencyScoped,c==null?void 0:c.code,h.skillField)});if(!R.isLatest(re))return;if(Ce?e.setContent($t,Lt):e.appendContent($t,Lt),Ce)if(!Pe||!h.skillField||!h.frameworkId)P();else{const{frameworkId:T,skillField:D}=h,j=xa(h.skills,h.terms),z={filters:xe,isMatch:Q=>WB(Q,T,D,j),matchedCount:Lt,query:J,sortBy:qt,fields:xf(n.competencyScoped,c==null?void 0:c.code,h.skillField)};F.current=z,O(z,0)}}catch(ke){console.error("[useLibrary] load error:",ke)}finally{R.isLatest(re)&&e.setLoading(!1)}},[r,t,n,s,V,W,c,u,ue,m==null?void 0:m.frameworkId,m==null?void 0:m.roleSkillValues,b,h]);g.useEffect(()=>{clearTimeout(d.current),e.setSearch("")},[u]),g.useEffect(()=>{ie()},[t,n.key]),g.useEffect(()=>{n.competencyScoped&&ie()},[n.competencyScoped,s,o,W.join("|"),u,m==null?void 0:m.frameworkId,m==null?void 0:m.roleSkillValues.join("|")]);const ve=h.skills.join("|"),me=g.useRef(!1);g.useEffect(()=>{if(!me.current){me.current=!0;return}n.competencyScoped||ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ)},[h.ready,h.frameworkId,h.skillField,ve]);const H=g.useCallback(J=>{e.setSearch(J),clearTimeout(d.current),d.current=setTimeout(()=>ie(J,e.activeFilter,e.advancedFilters,!0,e.sortAZ),300)},[e.activeFilter,e.advancedFilters,e.sortAZ,ie]),be=g.useCallback(J=>{e.setFilter(J),ie(e.searchQuery,J,e.advancedFilters,!0,e.sortAZ)},[e.searchQuery,e.advancedFilters,e.sortAZ,ie]),Te=g.useCallback(J=>{e.setAdvancedFilters(J),ie(e.searchQuery,e.activeFilter,J,!0,e.sortAZ)},[e.searchQuery,e.activeFilter,e.sortAZ,ie]),$=g.useCallback(()=>{const J=!e.sortAZ;e.setSortAZ(J),ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,J)},[e.sortAZ,e.searchQuery,e.activeFilter,e.advancedFilters,ie]),B=g.useCallback(()=>{e.isLoading||ie(e.searchQuery,e.activeFilter,e.advancedFilters,!1,e.sortAZ)},[e.isLoading,e.searchQuery,e.activeFilter,e.advancedFilters,e.sortAZ,ie]),le=e.allContent.length<e.totalCount,ge=g.useCallback(()=>{const J=F.current;!J||k||O(J,x)},[k,x,t]);return{content:e.filteredContent,isLoading:e.isLoading,totalCount:e.totalCount,activeFilter:e.activeFilter,advancedFilters:e.advancedFilters,searchQuery:e.searchQuery,sortAZ:e.sortAZ,hasMore:le,search:H,setFilter:be,applyAdvancedFilters:Te,toggleSort:$,loadMore:B,refetch:()=>ie(e.searchQuery,e.activeFilter,e.advancedFilters,!0,e.sortAZ),activeAssessmentSlot:s,emptyReason:ue,skillMatched:b,otherContent:p,otherTotal:C,otherLoading:k,otherHasMore:GB(x,w),loadMoreOther:ge,courseHint:KB(h)}}function mg(){var c;const e=fe(),t=Z(u=>u.editorProfile.competencyScoped),r=at(u=>u.activeAssessmentSlot),n=at(u=>u.activeLevelExamTarget),s=ae(u=>u.selectedNodeId),o=ae(u=>u.treeData),a=ae(u=>u.getNodeById),i=(c=o[0])==null?void 0:c.id;if(!t)return null;if(r==="pre")return e.learningPath.libraryAddPriorAssessmentCourse;if(r==="post")return e.learningPath.libraryAddOutcomeAssessmentCourse;if(n){const u=a(n);return e.learningPath.libraryAddLevelExamCourse.replace("{level}",(u==null?void 0:u.name)??"")}if(s&&s!==i){const u=a(s);if(u!=null&&u.isFolder)return e.learningPath.libraryAddToLevel.replace("{level}",u.name??"")}return e.learningPath.libraryOpenLevelToAdd}function gg(e){const t=(e.organisation??[]).map(n=>String(n??"").trim()).find(Boolean)??"",r=String(e.primaryCategory??"").trim();return[t,r].filter(Boolean).join(" · ")}function vg(e,t,r){var i;const n=(Array.isArray(e)?e:e!=null&&e!==""?[e]:[]).map(String),s=new Set(t.map(c=>{var u;return((u=so(c,r))==null?void 0:u.code)??c})),o=new Set,a=[];for(const c of n){const u=((i=so(c,r))==null?void 0:i.code)??c;o.has(u)||(o.add(u),a.push({code:u,label:Ya(c,r),matched:s.has(u)}))}return[...a.filter(c=>c.matched),...a.filter(c=>!c.matched)]}function yg(e,t){const{frameworkId:r,skillField:n,skills:s,terms:o}=t;return!r||!n||e.competencyFramework!==r?[]:vg(e[n],s,o)}const rq="_card_1nmp3_1",nq="_addBtn_1nmp3_17",sq="_dragging_1nmp3_24",oq="_ctIcon_1nmp3_29",aq="_info_1nmp3_33",iq="_name_1nmp3_41",lq="_meta_1nmp3_50",cq="_skillTags_1nmp3_58",uq="_skillTag_1nmp3_58",dq="_skillTagMatched_1nmp3_73",fq="_addBtnMuted_1nmp3_99",hq="_added_1nmp3_108",pq="_addedBadge_1nmp3_117",Wt={card:rq,addBtn:nq,dragging:sq,ctIcon:oq,info:aq,name:iq,meta:lq,skillTags:cq,skillTag:uq,skillTagMatched:dq,addBtnMuted:fq,added:hq,addedBadge:pq},mq={video:Ha,pdf:So,h5p:$a,scorm:Va,audio:Ua,quiz:qa,course:Fr,default:Cn},Ef=({item:e,onAdd:t,onPreview:r,isDraggable:n,isAdded:s})=>{const o=fe(),a=Ao(e),i=mq[a.key]??Cn,c=_c(),u=BD(),d=c&&!s&&u,f=Z(w=>w.editorProfile.competencyScoped),m=kr(),{roleSkills:h}=Kr(),b=Nc(),p=e,v=f?m?vg(p[m.code],h,m.terms):[]:yg(p,b),{attributes:y,listeners:C,setNodeRef:S,isDragging:x}=Lh({id:e.identifier,disabled:!n||!c||!u,data:{type:"library-item",item:e}}),_=()=>{r&&r(e)};return l.jsxs("div",{ref:S,className:[Wt.card,x?Wt.dragging:"",s?Wt.added:""].join(" "),"aria-label":e.name,...n?{...y,...C}:{},role:"listitem",onClick:_,children:[l.jsx("span",{className:[`sbx-ct-sq--${a.key}`,Wt.ctIcon].join(" "),"aria-hidden":"true",children:l.jsx(i,{size:14})}),l.jsxs("div",{className:Wt.info,children:[l.jsx("span",{className:Wt.name,title:e.name,children:e.name}),l.jsx("span",{className:Wt.meta,children:gg(e)}),v.length>0&&l.jsxs("span",{className:Wt.skillTags,children:[v.slice(0,3).map(w=>l.jsx("span",{className:[Wt.skillTag,w.matched?Wt.skillTagMatched:""].filter(Boolean).join(" "),children:w.label},w.code)),v.length>3&&l.jsx("span",{className:Wt.skillTag,title:v.slice(3).map(w=>w.label).join(", "),children:o.libraryCard.moreSkills.replace("{count}",String(v.length-3))})]})]}),s&&l.jsx("span",{className:Wt.addedBadge,"aria-label":o.libraryCard.alreadyAddedAriaLabel,title:o.libraryCard.alreadyAddedTitle,children:l.jsx(Es,{size:12})}),!s&&n&&l.jsx("button",{type:"button",className:[Wt.addBtn,!d&&c?Wt.addBtnMuted:""].join(" "),onClick:w=>{w.stopPropagation(),t(e)},disabled:!c,"aria-disabled":!d,"aria-label":o.libraryCard.addItemAriaLabel.replace("{name}",e.name),title:c?u?o.libraryCard.addToUnitTitle:o.libraryCard.selectUnitToAddTitle:o.libraryCard.draftOnlyTitle,children:l.jsx(Gr,{size:14})})]})},gq="_chips_xhhaq_1",vq="_chip_xhhaq_1",kf={chips:gq,chip:vq},yq=({filters:e,active:t,onChange:r})=>{const n=fe();return l.jsx("div",{className:kf.chips,role:"group","aria-label":n.filterChips.contentTypeFiltersAriaLabel,children:e.map(s=>l.jsx("button",{type:"button",role:"radio","aria-checked":t===s.value,className:["sbx-chip",t===s.value?"filled":"outline",kf.chip].join(" "),onClick:()=>r(s.value),children:s.label},s.value))})},bq="_panel_1iejx_1",Cq="_header_1iejx_10",Sq="_headerTitle_1iejx_19",xq="_closeBtn_1iejx_25",_q="_body_1iejx_43",wq="_section_1iejx_59",Tq="_sectionLabel_1iejx_65",Eq="_chips_1iejx_73",kq="_chip_1iejx_73",Aq="_active_1iejx_96",Lq="_footer_1iejx_102",Iq="_resetBtn_1iejx_112",Dq="_applyBtn_1iejx_129",xt={panel:bq,header:Cq,headerTitle:Sq,closeBtn:xq,body:_q,section:wq,sectionLabel:Tq,chips:Eq,chip:kq,active:Aq,footer:Lq,resetBtn:Iq,applyBtn:Dq},jq=e=>[{key:"board",label:e.libraryFilterPanel.boardLabel},{key:"medium",label:e.libraryFilterPanel.mediumLabel},{key:"gradeLevel",label:e.libraryFilterPanel.classLabel},{key:"subject",label:e.libraryFilterPanel.subjectLabel}],Oq=new Set(["board","medium","gradeLevel","subject","topic"]),Nq=({local:e,toggle:t})=>{const r=fe(),n=pg();return n.length?l.jsxs("div",{className:xt.section,children:[l.jsx("div",{className:xt.sectionLabel,children:r.libraryFilterPanel.primaryCategoryLabel}),l.jsx("div",{className:xt.chips,children:n.map(s=>l.jsx("button",{type:"button",className:[xt.chip,(e.primaryCategory??[]).includes(s)?xt.active:""].join(" "),onClick:()=>t("primaryCategory",s),children:s},s))})]}):null},Rq=({isOpen:e,filters:t,onApply:r,onClose:n})=>{var v,y;const s=fe(),o=Z(C=>C.editorConfig),a=Z(C=>C.searchFormConfig),i=Z(C=>C.contentFramework),c=Z(C=>C.contentTargetFWIds),{organisationFramework:u}=Xa(i??((v=o==null?void 0:o.context)==null?void 0:v.framework),c??((y=o==null?void 0:o.context)==null?void 0:y.targetFWIds)),[d,f]=g.useState(t),m=a!=null&&a.length?a.filter(C=>Oq.has(C.code)).map(C=>({key:C.code,label:C.label||C.code})):jq(s);g.useEffect(()=>{f(t)},[t]);const h=(C,S)=>{f(x=>{const _=x[C]??[],w=_.includes(S)?_.filter(E=>E!==S):[..._,S];return{...x,[C]:w}})},b=(u==null?void 0:u.categories)??[],p=C=>{var S;return((S=b.find(x=>x.code===C))==null?void 0:S.terms)??[]};return e?l.jsxs("div",{className:xt.panel,role:"dialog","aria-label":s.libraryFilterPanel.filterLibraryAriaLabel,"aria-modal":"true",children:[l.jsxs("div",{className:xt.header,children:[l.jsx("span",{className:xt.headerTitle,children:s.libraryFilterPanel.filtersHeaderTitle}),l.jsx("button",{type:"button",className:xt.closeBtn,onClick:n,"aria-label":s.libraryFilterPanel.closeFiltersAriaLabel,children:l.jsx(Mr,{size:16})})]}),l.jsxs("div",{className:xt.body,children:[m.map(({key:C,label:S})=>{const x=p(C);return x.length?l.jsxs("div",{className:xt.section,children:[l.jsx("div",{className:xt.sectionLabel,children:S}),l.jsx("div",{className:xt.chips,children:x.slice(0,20).map(_=>l.jsx("button",{type:"button",className:[xt.chip,(d[C]??[]).includes(_.name)?xt.active:""].join(" "),onClick:()=>h(C,_.name),children:_.name},_.identifier))})]},C):null}),l.jsx(Nq,{local:d,toggle:h})]}),l.jsxs("div",{className:xt.footer,children:[l.jsx("button",{type:"button",className:xt.resetBtn,onClick:()=>f({}),children:s.libraryFilterPanel.resetButton}),l.jsx("button",{type:"button",className:xt.applyBtn,onClick:()=>{r(d),n()},children:s.libraryFilterPanel.applyButton})]})]}):null},Pq="_header_u96hx_10",Fq="_headerCourse_u96hx_20",Mq="_courseIcon_u96hx_25",Bq="_titleGroup_u96hx_37",qq="_courseMeta_u96hx_45",$q="_title_u96hx_37",Uq="_headerActions_u96hx_67",Vq="_iconBtn_u96hx_74",Hq="_playerArea_u96hx_92",zq="_footer_u96hx_100",Qq="_footerCourse_u96hx_109",Wq="_addBtn_u96hx_115",Gq="_addBtnCourse_u96hx_134",Kq="_modalOverlay_u96hx_159",Yq="_modalOverlayCourse_u96hx_174",Zq="_modalPanel_u96hx_178",Xq="_modalPanelCourse_u96hx_190",Jq="_skillTags_u96hx_198",e$="_skillTag_u96hx_198",t$="_skillTagMatched_u96hx_213",dt={header:Pq,headerCourse:Fq,courseIcon:Mq,titleGroup:Bq,courseMeta:qq,title:$q,headerActions:Uq,iconBtn:Vq,playerArea:Hq,footer:zq,footerCourse:Qq,addBtn:Wq,addBtnCourse:Gq,modalOverlay:Kq,modalOverlayCourse:Yq,modalPanel:Zq,modalPanelCourse:Xq,skillTags:Jq,skillTag:e$,skillTagMatched:t$},r$="application/vnd.sunbird.questionset",n$=({content:e,editorMode:t,onAdd:r,onClose:n})=>{const s=fe(),o=t==="edit",a=Z(h=>h.editorProfile.competencyScoped),i=mg(),c=Nc();if(!e)return null;const u=a?[]:yg(e,c),d=a&&e.primaryCategory==="Course",f=gg(e),m={id:e.identifier,identifier:e.identifier,name:e.name??"",mimeType:e.mimeType,primaryCategory:e.primaryCategory,contentType:e.contentType,appIcon:e.appIcon,status:e.status,isFolder:!1,children:[],metadata:e};return Hr.createPortal(l.jsx("div",{className:[dt.modalOverlay,d?dt.modalOverlayCourse:""].filter(Boolean).join(" "),role:"dialog","aria-modal":"true","aria-label":s.libraryPreviewPanel.contentPreviewAriaLabel,onClick:n,children:l.jsxs("div",{className:[dt.modalPanel,d?dt.modalPanelCourse:""].filter(Boolean).join(" "),onClick:h=>h.stopPropagation(),children:[l.jsxs("div",{className:[dt.header,d?dt.headerCourse:""].filter(Boolean).join(" "),children:[d&&l.jsx("span",{className:dt.courseIcon,children:l.jsx(Fr,{size:20})}),l.jsxs("div",{className:dt.titleGroup,children:[l.jsx("span",{className:dt.title,title:e.name,children:e.name}),d&&f&&l.jsx("span",{className:dt.courseMeta,children:f}),u.length>0&&l.jsx("span",{className:dt.skillTags,children:u.map(h=>l.jsx("span",{className:[dt.skillTag,h.matched?dt.skillTagMatched:""].filter(Boolean).join(" "),children:h.label},h.code))})]}),l.jsx("div",{className:dt.headerActions,children:l.jsx("button",{type:"button",className:dt.iconBtn,onClick:n,"aria-label":s.libraryPreviewPanel.closePreviewAriaLabel,children:l.jsx(Mr,{size:16})})})]}),l.jsx("div",{className:dt.playerArea,children:d?l.jsx(ug,{courseId:e.identifier}):l.jsx(ql,{node:m,editorMode:"read",type:e.mimeType===r$?"quml":"content"})}),o&&l.jsx("div",{className:[dt.footer,d?dt.footerCourse:""].filter(Boolean).join(" "),children:d?l.jsxs("button",{type:"button",className:dt.addBtnCourse,onClick:()=>r(e),children:[l.jsx(Gr,{size:15})," ",i??s.libraryPreviewPanel.addToUnitButton]}):l.jsx("button",{type:"button",className:dt.addBtn,onClick:()=>r(e),children:s.libraryPreviewPanel.addToUnitButton})})]})}),document.body)},s$="_dock_1rq19_1",o$="_header_1rq19_8",a$="_libraryTargetLabel_1rq19_18",i$="_libraryTargetChip_1rq19_28",l$="_headerLeft_1rq19_46",c$="_headerTitle_1rq19_54",u$="_count_1rq19_60",d$="_searchRow_1rq19_69",f$="_searchWrap_1rq19_77",h$="_searchIcon_1rq19_83",p$="_searchInput_1rq19_92",m$="_filterToggleBtn_1rq19_110",g$="_filterToggleBtnActive_1rq19_129",v$="_filterBadge_1rq19_135",y$="_filters_1rq19_154",b$="_mainArea_1rq19_164",C$="_sidePanelOverlay_1rq19_173",S$="_cardList_1rq19_182",x$="_skeleton_1rq19_198",_$="_skeletonIcon_1rq19_208",w$="_skeletonText_1rq19_216",T$="_skeletonLine_1rq19_223",E$="_skeletonLineSm_1rq19_230",k$="_loadMoreBtn_1rq19_245",A$="_emptyState_1rq19_270",L$="_collapseBtn_1rq19_290",I$="_courseHint_1rq19_309",D$="_sectionHeading_1rq19_326",j$="_otherContent_1rq19_335",O$="_otherContentToggle_1rq19_344",N$="_otherContentHint_1rq19_359",Be={dock:s$,header:o$,libraryTargetLabel:a$,libraryTargetChip:i$,headerLeft:l$,headerTitle:c$,count:u$,searchRow:d$,searchWrap:f$,searchIcon:h$,searchInput:p$,filterToggleBtn:m$,filterToggleBtnActive:g$,filterBadge:v$,filters:y$,mainArea:b$,sidePanelOverlay:C$,cardList:S$,skeleton:x$,skeletonIcon:_$,skeletonText:w$,skeletonLine:T$,skeletonLineSm:E$,loadMoreBtn:k$,emptyState:A$,collapseBtn:L$,courseHint:I$,sectionHeading:D$,otherContent:j$,otherContentToggle:O$,otherContentHint:N$},R$=[{label:"Courses",value:"all"}];function P$(e){const t=new Set,r=[...e];for(;r.length>0;){const n=r.shift();n.isFolder||t.add(n.identifier),n.children&&r.push(...n.children)}return t}const F$=({editorMode:e,collapsed:t=!1,onToggleCollapse:r})=>{const n=fe(),{content:s,isLoading:o,totalCount:a,activeFilter:i,searchQuery:c,sortAZ:u,hasMore:d,search:f,setFilter:m,applyAdvancedFilters:h,toggleSort:b,loadMore:p,activeAssessmentSlot:v,emptyReason:y,skillMatched:C,otherContent:S,otherTotal:x,otherLoading:_,otherHasMore:w,loadMoreOther:E,courseHint:k}=tq(),[N,F]=g.useState(!1),{addResource:I,selectedNodeId:R,treeData:P,treeCache:O}=ae(),V=at(U=>U.setActiveAssessmentSlot),ne=at(U=>U.activeLevelExamTarget),W=at(U=>U.setActiveLevelExamTarget),ue=Z(U=>U.editorProfile.competencyScoped),ie=Z(U=>U.editorProfile.restrictedContentCategories),ve=e==="edit",me=mg(),[H,be]=g.useState(!1),[Te,$]=g.useState({}),[B,le]=g.useState(null),ge=g.useMemo(()=>P$(P),[P]),J=g.useCallback((U,Ee)=>{var xe,Pe;const we=(xe=P[0])==null?void 0:xe.id;if(!we)return;if(oo(((Pe=P[0])==null?void 0:Pe.children)??[],Ee)){Se.error(Ee==="pre"?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}if(!ss(U)){Se.error(n.learningPath.notAssessmentCourseToast.replace("{name}",U.name));return}if(I(U,we,{isAssessmentCourse:!0,slot:Ee})===!1){Se.error(n.learningPath.bothSlotsFilledToast);return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",U.name)),V(null)},[P,I,V,n]),de=g.useCallback((U,Ee)=>{var Pe;const we=ae.getState().getNodeById(Ee);if(!we)return;if(xp(we)){Se.error(n.learningPath.levelExamAlreadyFilledToast);return}if(!ss(U)){Se.error(n.learningPath.notAssessmentCourseToast.replace("{name}",U.name));return}const ke=((Pe=P[0])==null?void 0:Pe.children)??[];if(qu(ke,we)){Se.error(n.learningPath.levelNeedsMixedContentToast);return}if(I(U,Ee,{isAssessmentCourse:!0})===!1){Se.error(n.learningPath.itemAlreadyInPathToast.replace("{name}",U.name));return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",U.name)),W(null)},[P,I,W,n]),X=g.useCallback(U=>{var xe,Pe,qt,lr;if(v){J(U,v);return}if(ne){de(U,ne);return}if(ue&&!Tp(P[0],O)&&!Za(P[0],O)){Se.error(n.learningPath.selectCurriculumFirstToast);return}if(!R){Se.error(ue?n.learningPath.selectLevelFirstToast:n.libraryDock.selectUnitFirstToast);return}const Ee=(xe=P[0])==null?void 0:xe.id,we=ae.getState().getNodeById(R);if(ue){const $t=((Pe=P[0])==null?void 0:Pe.children)??[],Lt=we!=null&&we.isFolder?we:we!=null&&we.parent?ae.getState().getNodeById(we.parent):void 0;if(Lt&&Cl($t,Lt)){const T=(qt=$t[0])==null?void 0:qt.id;Se.error(Lt.id===T?n.learningPath.priorSlotFilledToast:n.learningPath.outcomeSlotFilledToast);return}}if(R===Ee||!(we!=null&&we.isFolder)){Se(ue?n.learningPath.selectLevelFromOutlineToast:n.libraryDock.selectUnitFromOutlineToast,{icon:l.jsx(Vr,{size:16}),duration:4e3});return}if(ue&&qu(((lr=P[0])==null?void 0:lr.children)??[],we)&&ss(U)){Se.error(n.learningPath.levelNeedsMixedContentToast);return}if(I(U,R)===!1){Se.error((ue?n.learningPath.itemAlreadyInPathToast:n.libraryDock.itemAlreadyAddedToast).replace("{name}",U.name));return}Se.success(n.libraryDock.itemAddedToast.replace("{name}",U.name))},[v,J,ne,de,R,I,P,O,n,ue]),Ce=g.useCallback(U=>{$(U),h(U)},[h]),Ne=g.useCallback(U=>{le(U)},[]),re=g.useCallback(U=>{X(U),le(null)},[X]),ce=g.useMemo(()=>Object.values(Te).reduce((U,Ee)=>U+((Ee==null?void 0:Ee.length)??0),0),[Te]),G=()=>C&&x>0?l.jsxs("div",{className:Be.otherContent,"data-testid":"library-other-content",children:[l.jsxs("button",{type:"button",className:Be.otherContentToggle,onClick:()=>F(U=>!U),"aria-expanded":N,children:[N?l.jsx(bn,{size:14}):l.jsx(Ba,{size:14}),l.jsx("span",{children:n.libraryDock.otherContentHeading.replace("{count}",String(x))})]}),N&&l.jsxs(l.Fragment,{children:[l.jsx("span",{className:Be.otherContentHint,children:n.libraryDock.otherContentHint}),S.map(U=>l.jsx(Ef,{item:U,onAdd:X,onPreview:Ne,isDraggable:ve,isAdded:ge.has(U.identifier)},U.identifier)),w&&l.jsx("button",{type:"button",className:Be.loadMoreBtn,onClick:E,disabled:_,"aria-label":n.libraryDock.loadMoreAriaLabel,children:_?n.libraryDock.loadingText:n.libraryDock.loadMoreText})]})]}):null;return l.jsxs("div",{className:Be.dock,children:[l.jsxs("div",{className:Be.header,children:[l.jsxs("div",{className:Be.headerLeft,children:[l.jsx("button",{type:"button",className:Be.collapseBtn,onClick:r,"aria-label":n.libraryDock.collapseLibraryPanelAriaLabel,title:n.libraryDock.collapseLibraryTitle,children:l.jsx(Hb,{size:15})}),l.jsx(qb,{size:16}),l.jsx("span",{className:Be.headerTitle,children:n.libraryDock.headerTitle}),a>0&&l.jsx("span",{className:Be.count,children:a})]}),me&&(v||ne?l.jsxs("button",{type:"button",className:Be.libraryTargetChip,onClick:()=>V(null),"aria-label":n.libraryDock.cancelTargetAriaLabel,title:n.libraryDock.cancelTargetAriaLabel,children:[l.jsx("span",{className:Be.libraryTargetLabel,children:me}),l.jsx(Mr,{size:11,"aria-hidden":"true"})]}):l.jsx("span",{className:Be.libraryTargetLabel,children:me}))]}),l.jsxs("div",{className:Be.searchRow,children:[l.jsxs("div",{className:Be.searchWrap,children:[l.jsx(ya,{size:14,className:Be.searchIcon}),l.jsx("input",{type:"search",className:Be.searchInput,placeholder:n.libraryDock.searchPlaceholder,value:c,onChange:U=>f(U.target.value),"aria-label":n.libraryDock.searchAriaLabel})]}),l.jsx("button",{type:"button",className:[Be.filterToggleBtn,u?Be.filterToggleBtnActive:""].join(" "),onClick:b,"aria-label":u?n.libraryDock.sortAZAriaLabel:n.libraryDock.sortRecentAriaLabel,title:u?n.libraryDock.sortAZTitle:n.libraryDock.sortRecentTitle,children:u?l.jsx(Lb,{size:15}):l.jsx(Nb,{size:15})}),!ue&&l.jsxs("button",{type:"button",className:[Be.filterToggleBtn,H?Be.filterToggleBtnActive:""].join(" "),onClick:()=>be(U=>!U),"aria-label":n.libraryDock.toggleAdvancedFiltersAriaLabel,"aria-pressed":H,title:n.libraryDock.advancedFiltersTitle,children:[l.jsx(Xb,{size:15}),ce>0&&l.jsx("span",{className:Be.filterBadge,children:ce})]})]}),l.jsx("div",{className:Be.filters,children:l.jsx(yq,{filters:ue?R$:ie?[Pi[0],...Pi.filter(U=>ie.includes(U.value))]:Pi,active:i,onChange:m})}),l.jsxs("div",{className:Be.mainArea,children:[l.jsxs("div",{className:Be.cardList,role:"list","aria-label":n.libraryDock.libraryContentAriaLabel,children:[k==="pickSkills"&&l.jsxs("div",{className:Be.courseHint,"data-testid":"library-pick-skills-hint",children:[l.jsx(Vr,{size:14}),l.jsx("span",{children:n.libraryDock.pickSkillsHint})]}),C&&s.length>0&&l.jsx("div",{className:Be.sectionHeading,children:n.libraryDock.matchingHeading}),o&&s.length===0?Array.from({length:4}).map((U,Ee)=>l.jsxs("div",{className:Be.skeleton,"aria-hidden":"true",children:[l.jsx("div",{className:Be.skeletonIcon}),l.jsxs("div",{className:Be.skeletonText,children:[l.jsx("div",{className:Be.skeletonLine}),l.jsx("div",{className:Be.skeletonLineSm})]})]},Ee)):s.length>0?l.jsxs(l.Fragment,{children:[s.map(U=>l.jsx(Ef,{item:U,onAdd:X,onPreview:Ne,isDraggable:ve,isAdded:ge.has(U.identifier)},U.identifier)),d&&l.jsx("button",{type:"button",className:Be.loadMoreBtn,onClick:p,disabled:o,"aria-label":n.libraryDock.loadMoreAriaLabel,children:o?n.libraryDock.loadingText:n.libraryDock.loadMoreText}),G()]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:Be.emptyState,children:[l.jsx(ya,{size:24}),y==="noCurriculum"?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.learningPath.noCurriculumEmptyTitle}),l.jsx("span",{children:n.learningPath.noCurriculumEmptyHint})]}):C?l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noSkillMatchTitle}),l.jsx("span",{children:n.libraryDock.noSkillMatchHint})]}):l.jsxs(l.Fragment,{children:[l.jsx("p",{children:n.libraryDock.noContentFound}),l.jsx("span",{children:n.libraryDock.tryDifferentSearch})]})]}),G()]})]}),H&&l.jsx("div",{className:Be.sidePanelOverlay,children:l.jsx(Rq,{isOpen:H,filters:Te,onApply:Ce,onClose:()=>be(!1)})}),B&&l.jsx(n$,{content:B,editorMode:e,onAdd:re,onClose:()=>le(null)})]})]})};function M$(e,t,r,n=za){const s={},o={},a=new Set(["id","isFolder","children","parent","isNew","breadcrumb","title","relationalMetadata","optional","metadata","isAssessmentCourse"]),i=new Set(["targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","targetFWIds","targetTopicIds","topic","topicsIds"]),c=new Set(["audience","attributions","keywords","language","additionalCategories","medium","gradeLevel","subject","boardIds","mediumIds","gradeLevelIds","subjectIds","targetBoardIds","targetMediumIds","targetGradeLevelIds","targetSubjectIds","industry","domain","dialcodes"]),u=new Set(["copyrightYear","compatibilityLevel","version"]);function d(h,b=!1){const p={};for(const[v,y]of Object.entries(h))if(!a.has(v)&&!(b&&i.has(v)))if(c.has(v))Array.isArray(y)?p[v]=y:y!=null&&y!==""?p[v]=[y]:p[v]=[];else if(u.has(v)){const C=Number(y);isNaN(C)||(p[v]=C)}else p[v]=y;return p}function f(h){var p;const b={};for(const v of h.children??[]){if(v.isFolder)continue;const y=t[v.identifier];if(!y)continue;const{isNew:C,...S}=y;if(Object.keys(S).length===0)continue;const x=((p=v.metadata)==null?void 0:p.relationalMetadata)??{};b[v.identifier]={name:v.name,...x,...S}}return b}function m(h,b){var x,_;const p=h.identifier,v=t[p],y=p.startsWith("temp-")||!!(v!=null&&v.isNew),C=!h.isFolder&&!b;if(b||y||v&&!C){let w;if(y)w={mimeType:"application/vnd.ekstep.content-collection",code:p,contentType:((x=h.metadata)==null?void 0:x.contentType)??n.unitContentType,primaryCategory:((_=h.metadata)==null?void 0:_.primaryCategory)??n.unitPrimaryCategory,name:h.name,visibility:"Parent",channel:r,...d(h.metadata??{})};else if(b){const{isNew:E,...k}=v??{};w={...d(h.metadata??{},!0),...d(k,!1),name:h.name}}else{const{isNew:E,...k}=v??{};w={name:h.name,visibility:"Parent",...d(k,!0)}}s[p]={metadata:w,objectType:h.objectType||(h.isFolder?"Collection":"Content"),root:b,isNew:y}}const S=h.isFolder?f(h):{};o[p]={name:h.name,children:(h.children??[]).map(w=>w.identifier),...Object.keys(S).length>0?{relationalMetadata:S}:{},root:b},(h.children??[]).forEach(w=>m(w,!1))}return e.forEach((h,b)=>m(h,b===0)),{nodesModified:s,hierarchy:o}}function B$(){const[e,t]=g.useState(!1),r=ae(d=>d.treeCache),n=ae(d=>d.treeData),s=Z(d=>d.isDirty),o=Z(d=>d.lastSaved),{setIsDirty:a,setLastSaved:i}=Z(),c=Z(d=>d.editorConfig);return{save:g.useCallback(async()=>{if(!c||e)return;const d=c.context.contentId??c.context.identifier??"";if(!d)return;if(n.length===0){Se.error("Collection is empty. Please reload before saving.");return}const f=c.context.channel??"",m=c.context.userId??c.context.uid??"";t(!0);try{const h=Z.getState().editorProfile,{nodesModified:b,hierarchy:p}=M$(n,r,f,h),{identifiers:v}=await f0(d,b,p,m);v&&Object.keys(v).length>0&&ae.getState().replaceNodeIds(v);const y=new Date().toISOString();i(y),a(!1)}catch(h){console.error("[useSaveHierarchy] save failed:",h),Se.error("Failed to save. Please try again.")}finally{t(!1)}},[c,e,n,r,a,i]),isSaving:e,isDirty:s,lastSaved:o}}const q$={};function $$(e){return e==null||e===""||Array.isArray(e)&&e.length===0}function U$(e,t,r,n,s,o=q$){const a=[],i=(c,u)=>{var d;for(const f of c){const m=u&&!f.parent,h=m?r:f.isFolder?n:null;if(h&&h.length>0){const b={...f.metadata??{},...t[f.id]??{}},v=Wm(h,b,o,m,s).filter(y=>y.required&&y.visible!==!1&&y.inputType!=="appIcon"&&$$(y.currentValue)).map(y=>y.label);v.length>0&&a.push({nodeId:f.id,nodeName:f.name||"Untitled",missing:v})}(d=f.children)!=null&&d.length&&i(f.children,!1)}};return i(e,!0),a}function V$(e){var x,_;const t=Z(w=>w.editorConfig),r=Z(w=>w.editorProfile),n=Z(w=>w.setButtonLoader),s=Z(w=>w.validateAllForms),o=Z(w=>w.rootFormConfig),a=Z(w=>w.unitFormConfig),i=ae(w=>w.treeData),c=ae(w=>w.treeCache),u=ae(w=>w.selectNode),d=kr(),{scope:f}=Is(),{roleSkills:m}=Kr(),h=Z(w=>w.contentFramework),b=Z(w=>w.contentTargetFWIds),{organisationFramework:p,targetFrameworks:v}=Xa(h??((x=t==null?void 0:t.context)==null?void 0:x.framework),b??((_=t==null?void 0:t.context)==null?void 0:_.targetFWIds)),y=g.useCallback(()=>{var F,I,R;const w={editorMode:"edit",objectType:(F=t==null?void 0:t.config)==null?void 0:F.objectType,userFullName:(R=(I=t==null?void 0:t.context)==null?void 0:I.user)==null?void 0:R.fullName},E=U$(i,c,o,a,w,{organisationFramework:p,targetFrameworks:v});if(E.length===0)return!0;const k=E[0];Se.error(`"${k.nodeName}": please fill required field${k.missing.length>1?"s":""} — ${k.missing.join(", ")}`);const{setFormStatus:N}=Z.getState();return E.forEach(P=>N(P.nodeId,!1)),u(k.nodeId),!1},[i,c,o,a,t,u,p,v]),C=g.useCallback(()=>{if(r.key!=="learningPath")return!0;const w=dc(i[0],d==null?void 0:d.code,f,c,d==null?void 0:d.terms,m);return w.length===0?!0:(Se.error(w[0].message),!1)},[r.key,i,c,d,f,m]);return{runAction:g.useCallback(async(w,E)=>{var F,I,R,P;const k=((F=t==null?void 0:t.context)==null?void 0:F.contentId)??((I=t==null?void 0:t.context)==null?void 0:I.identifier)??"";if(!k)return Se.error("No content identifier found."),!1;const N=((R=t==null?void 0:t.context)==null?void 0:R.userId)??((P=t==null?void 0:t.context)==null?void 0:P.uid)??"";try{switch(w){case"sendForReview":return y()?s(i)?C()?(n("saveCollection",!0),await e(),await m0(k),Se.success("Content sent for review"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before sending for review."),!1):!1;case"reject":{n("rejectCollection",!0);const O=(E==null?void 0:E.comment)??"";return await g0(k,O),Se.success("Content rejected and sent back to the author"),!0}case"publish":return y()?s(i)?C()?(n("publishCollection",!0),await e(),await h0(k,N),Se.success("Content published successfully"),!0):!1:(Se.error("Some units have missing required fields. Please fill them before publishing."),!1):!1;default:return!1}}catch(O){console.error(`[useToolbarActions] ${w} failed`,O);const V=w==="sendForReview"?"send for review":w==="reject"?"reject":"publish";return Se.error(`Failed to ${V}. Please try again.`),!1}finally{n("saveCollection",!1),n("rejectCollection",!1),n("publishCollection",!1)}},[t,e,n,y,C,s,i]),checkRequiredFields:y}}function H$(){const e=fe(),t=Z(c=>c.editorProfile.key==="learningPath"),r=ae(c=>c.treeData),n=kr(),{scope:s,source:o}=Is(),a=g.useRef(!1),i=g.useRef("");g.useEffect(()=>{if(!t||o!=="prior"||!n)return;const c=E0(r[0],n.code,s,n.terms),u=c.map(d=>d.id).sort().join(",");a.current?c.length>0&&u!==i.current&&Se.error(e.learningPath.priorAssessmentNarrowedScopeToast.replace("{count}",String(c.length))):a.current=!0,i.current=u},[t,o,s.join("|"),n==null?void 0:n.code,r])}function z$(e,t,r,n){return e.flatMap(s=>{var d,f;if(ot(s))return[];const o=ko(s,t,n),a=Sn(((d=r[s.id])==null?void 0:d[t])??((f=s.metadata)==null?void 0:f[t]),n),i=[...o].sort(),c=[...a].sort();return i.length===c.length&&i.every((m,h)=>m===c[h])?[]:[{id:s.id,skills:o}]})}function Q$(){const e=Z(c=>c.editorProfile.key==="learningPath"),t=ae(c=>c.treeData),r=ae(c=>c.treeCache),n=ae(c=>c.updateNode),s=kr(),o=s==null?void 0:s.code,a=s==null?void 0:s.terms,{roleSkills:i}=Kr();g.useEffect(()=>{var c;!e||!o||z$(((c=t[0])==null?void 0:c.children)??[],o,r,a).forEach(({id:u,skills:d})=>n(u,{[o]:d},[o],{silent:!0}))},[e,t,r,o,a,n]),g.useEffect(()=>{if(!e||!o)return;const c=t[0],u=T0(c,o,r,a,i);u!==null&&n(c.id,{[o]:u},[o],{silent:!0})},[e,t,r,o,a,i,n])}const W$="_shell_1k9or_1",G$="_workspace_1k9or_8",K$="_sidebarCollapsed_1k9or_16",Y$="_dockCollapsed_1k9or_19",Z$="_dock_1k9or_19",X$="_outline_1k9or_40",J$="_reopenTab_1k9or_45",eU="_outlineHidden_1k9or_79",tU="_editor_1k9or_86",rU="_editorLp_1k9or_92",nU="_dockHidden_1k9or_105",sU="_dockReopenTab_1k9or_112",oU="_dragChip_1k9or_137",aU="_dragChipLabel_1k9or_152",Gt={shell:W$,workspace:G$,sidebarCollapsed:K$,dockCollapsed:Y$,dock:Z$,outline:X$,reopenTab:J$,outlineHidden:eU,editor:tU,editorLp:rU,dockHidden:nU,dockReopenTab:sU,dragChip:oU,dragChipLabel:aU},iU=({editorMode:e,onToolbarEvent:t,onContentAdded:r,onHierarchySaved:n})=>{const s=fe(),[o,a]=g.useState(null),[i,c]=g.useState(!1),[u,d]=g.useState(!1),[f,m]=g.useState(!1);H$(),Q$();const{addResource:h,treeData:b,treeCache:p}=ae(),v=Z(W=>W.setFormStatus),y=Z(W=>W.editorProfile.key==="learningPath"),[C,S]=g.useState(!0),x=ae(W=>W.selectedNodeId),{save:_,isSaving:w,isDirty:E,lastSaved:k}=B$(),{runAction:N,checkRequiredFields:F}=V$(_);g.useEffect(()=>{if(!E)return;const W=ue=>{ue.preventDefault(),ue.returnValue=""};return window.addEventListener("beforeunload",W),()=>window.removeEventListener("beforeunload",W)},[E]);const I=uh(al(Pa,{activationConstraint:{distance:8}})),R=g.useCallback(W=>{var ie;const ue=(ie=W.active.data.current)==null?void 0:ie.item;ue&&a(ue)},[]),P=g.useCallback(W=>{var $,B,le,ge,J;a(null);const ue=($=W.active.data.current)==null?void 0:$.item;if(!ue)return;if(y&&!Tp(b[0],p)){Se.error(s.learningPath.selectCurriculumFirstToast);return}const ie=W.over,ve=(ie==null?void 0:ie.id)??x??void 0,me=y?s.learningPath.dropOntoLevelError:s.splitBuilderShell.dropOntoUnitError;if(!ve){Se.error(me);return}const H=(B=b[0])==null?void 0:B.id;if(ve===H){Se.error(y?s.learningPath.dropOntoPathError:s.splitBuilderShell.dropOntoCourseError);return}const be=ae.getState().getNodeById(ve);if(!(be!=null&&be.isFolder)){Se.error(me);return}if(y&&ot(be)){const de=(J=(ge=(le=b[0])==null?void 0:le.children)==null?void 0:ge[0])==null?void 0:J.id;Se.error(be.id===de?s.learningPath.priorSlotFilledToast:s.learningPath.outcomeSlotFilledToast);return}if(!h(ue,ve)){Se.error((y?s.learningPath.itemAlreadyInPathToast:s.splitBuilderShell.alreadyInCollectionError).replace("{name}",ue.name));return}r==null||r(ue,ve),Se.success((y?s.learningPath.addedToLevelSuccess:s.splitBuilderShell.addedToUnitSuccess).replace("{name}",ue.name))},[x,h,b,p,r,s,y]),O=g.useCallback(async W=>{if(W.action==="onFormStatusChange"){const{isValid:ue,nodeId:ie}=W.data??{},ve=ue!==!1;S(ve),ie&&v(ie,ve);return}if(W.action==="back"&&E&&e==="edit"){m(!0);return}if(W.action==="saveCollection"){if(!C){Se.error(s.splitBuilderShell.fillRequiredMetadataError);return}if(!F())return;await _(),n==null||n(b),t==null||t(W);return}if(W.action==="sendForReview"||W.action==="reject"||W.action==="publish"){await N(W.action,W.data)&&(t==null||t(W));return}t==null||t(W)},[_,N,F,t,n,b,E,C,e,s]),V=g.useCallback(async()=>{if(!F()){m(!1);return}await _(),m(!1),n==null||n(b),t==null||t({action:"back"})},[_,F,n,t,b]),ne=g.useCallback(()=>{m(!1),t==null||t({action:"back"})},[t]);return l.jsxs(ul,{sensors:I,onDragStart:R,onDragEnd:P,children:[l.jsxs("div",{className:Gt.shell,children:[l.jsx(TE,{editorMode:e,isSaving:w,isDirty:E,lastSaved:k,isFormValid:C,onToolbarEvent:O}),l.jsxs("div",{className:[Gt.workspace,i?Gt.sidebarCollapsed:"",u?Gt.dockCollapsed:""].filter(Boolean).join(" "),children:[l.jsx("aside",{className:[Gt.outline,i?Gt.outlineHidden:""].join(" "),"aria-label":s.splitBuilderShell.outlineAriaLabel,"aria-hidden":i,children:l.jsx(nO,{editorMode:e,collapsed:i,onToggleCollapse:()=>c(W=>!W)})}),i&&l.jsx("button",{className:Gt.reopenTab,onClick:()=>c(!1),title:s.splitBuilderShell.showOutlineTitle,type:"button",children:"›"}),l.jsx("main",{className:[Gt.editor,y?Gt.editorLp:""].filter(Boolean).join(" "),role:"main","aria-label":s.splitBuilderShell.editorAriaLabel,children:l.jsx(qB,{editorMode:e,onToolbarEvent:O})}),l.jsx("aside",{className:[Gt.dock,u?Gt.dockHidden:""].filter(Boolean).join(" "),"aria-label":s.splitBuilderShell.libraryAriaLabel,"aria-hidden":u,children:l.jsx(F$,{editorMode:e,collapsed:u,onToggleCollapse:()=>d(W=>!W)})}),u&&l.jsx("button",{className:Gt.dockReopenTab,onClick:()=>d(!1),title:s.splitBuilderShell.showLibraryTitle,type:"button",children:"‹"})]})]}),l.jsx(wb,{dropAnimation:null,children:o?l.jsx("div",{className:Gt.dragChip,children:l.jsx("span",{className:Gt.dragChipLabel,children:o.name})}):null}),f&&l.jsx(EE,{onSave:V,onDiscard:ne,onCancel:()=>m(!1),isSaving:w})]})},lU="v1";function cU(e){const t=e.validations,r=t==null?void 0:t.find(s=>s.type==="maxlength"||s.type==="maxLength");if(!r)return e.maxLength;const n=Number(r.value);return Number.isFinite(n)?n:void 0}function Af(e,t){var r;return{code:e.code??"",label:e.label??e.name??e.code??"",name:e.name,inputType:e.inputType,dataType:e.dataType,required:e.required===!0||Array.isArray(e.validations)&&e.validations.some(n=>n.type==="required")||String(((r=e.renderingHints)==null?void 0:r.class)??"").includes("required"),editable:e.editable!==!1,visible:e.visible!==!1,placeholder:e.placeholder,maxLength:cU(e),depends:e.depends,sourceCategory:e.sourceCategory,range:e.range,enum:e.enum,default:e.default,defaultValue:e.defaultValue,index:e.index,section:t,output:e.output}}function nn(e){const t=e==null?void 0:e.properties;if(!Array.isArray(t))return[];const r=[];for(const n of t)if(Array.isArray(n.fields)){const s=n.name??void 0,o=n.fields.filter(a=>!!a.code).sort((a,i)=>(a.index??0)-(i.index??0));for(const a of o)r.push(Af(a,s))}else n.code&&r.push(Af(n));return r}function uU(e){const t=e==null?void 0:e.properties;if(!t)return{};const r={};for(const[n,s]of Object.entries(t))s&&"default"in s&&(r[n]=s.default);return r}async function dU(e,t,r="Collection",n=lU){var u,d;const o=(d=(u=(await Ue.post(`/action/object/category/definition/${n}/read?fields=objectMetadata,forms,name,label`,{request:{objectCategoryDefinition:{objectType:r,name:e,...t?{channel:t}:{}}}})).data)==null?void 0:u.result)==null?void 0:d.objectCategoryDefinition,a=(o==null?void 0:o.forms)??{},i=(o==null?void 0:o.objectMetadata)??{},c=i.config??{};return{rootForm:nn(a.create),unitForm:nn(a.unitMetadata),childForm:nn(a.childMetadata),searchForm:nn(a.search??a.searchConfig),relationalForm:nn(a.relationalMetadata),publishChecklist:nn(a.publishchecklist),reviewChecklist:nn(a.review),rfcChecklist:nn(a.requestforchangeschecklist),schemaDefaults:uU(i.schema),frameworkMetadata:c.frameworkMetadata??{},sourcingSettings:c.sourcingSettings??{}}}function Lf(e,t,r){return{framework:e.framework??t??r.framework??null,targetFWIds:e.targetFWIds??r.targetFWIds??null}}function fU({config:e,onError:t}){const[r,n]=g.useState(!0),[s,o]=g.useState(null),[a,i]=g.useState(!1),{setEditorConfig:c,setEditorMode:u,setCategoryDefinition:d,setContentFramework:f,setEditorProfile:m}=Z(),{setTreeData:h,selectNode:b}=ae();return g.useEffect(()=>{let p=!1;async function v(){var y,C,S;try{n(!0),o(null),e.apiBaseUrl&&dp(e.apiBaseUrl),c(e),u(e.config.mode),m(bC(e));const x=e.context.contentId??e.context.identifier??"",_=e.context.channel??"";let w;if(_)try{w=(y=await Hm(_))==null?void 0:y.defaultFramework}catch{}let E=!1;if(x){const k=e.config.objectType==="QuestionSet";let{rootNode:N}=k?await d0(x):await pp(x);if(N&&e.config.primaryCategory==="Learning Path"&&(N=C0(N)),!p&&(h(N?[N]:[]),N)){b(N.id);const{framework:O,targetFWIds:V}=Lf(N.metadata??{},w,e.context);f(O,V),E=!0}const F=e.config.primaryCategory??"Course",I=e.context.channel??"",R=e.config.categoryDefinitionApiVersion??"v1";try{const P=await dU(F,I,e.config.objectType??"Collection",R);if(!p){d(P);const O=((C=P.sourcingSettings)==null?void 0:C.collection)??{},V={};O.maxDepth&&!e.config.maxDepth&&(V.maxDepth=O.maxDepth),O.children&&!e.config.children&&(V.children=O.children),O.hierarchy&&!((S=e.config.hierarchy)!=null&&S.level1)&&(V.hierarchy={...e.config.hierarchy??{},...O.hierarchy}),Object.keys(V).length>0&&c({...e,config:{...e.config,...V}})}}catch{}}if(!p&&!E){const{framework:k,targetFWIds:N}=Lf({},w,e.context);f(k,N)}p||i(!0)}catch(x){if(!p){const _=x instanceof Error?x:new Error(String(x));o(_),t==null||t(_)}}finally{p||n(!1)}}return v(),()=>{p=!0}},[e.context.contentId,e.context.identifier]),{isLoading:r,error:s,isReady:a}}function hU(){const e=tc(t=>t.setLanguage);g.useEffect(()=>{e(localStorage.getItem(hl)||"en",{broadcast:!1});const t=n=>{n.key===hl&&n.newValue&&e(n.newValue,{broadcast:!1})},r=n=>{var o;const s=(o=n.detail)==null?void 0:o.lang;s&&e(s,{broadcast:!1})};return window.addEventListener("storage",t),window.addEventListener(pl,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(pl,r)}},[e])}const pU="_root_qcpw6_1",mU="_loadingState_qcpw6_10",gU="_loadingSpinner_qcpw6_20",vU="_errorState_qcpw6_34",zs={root:pU,loadingState:mU,loadingSpinner:gU,errorState:vU},yU=new Kg({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}});function bU({error:e,onRetry:t}){const r=fe();return l.jsxs("div",{className:zs.errorState,children:[l.jsx("h3",{children:r.collectionEditor.errorBoundaryTitle}),l.jsx("p",{children:e.message}),l.jsx("button",{onClick:t,children:r.collectionEditor.retryButton})]})}class CU extends g.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t){var r,n;(n=(r=this.props).onError)==null||n.call(r,t)}render(){return this.state.error?l.jsx(bU,{error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function SU(e){hU();const t=fe(),{isLoading:r,error:n}=fU({config:e,onError:e.onError}),s=Z(a=>a.editorMode),o=Z(a=>a.editorProfile);return r?l.jsxs("div",{className:zs.loadingState,children:[l.jsx("div",{className:zs.loadingSpinner}),l.jsx("p",{children:t.collectionEditor.loadingMessage})]}):n?l.jsxs("div",{className:zs.errorState,children:[l.jsx("h3",{children:t.collectionEditor.loadErrorTitle}),l.jsx("p",{children:n.message})]}):l.jsx("div",{className:["sb-split-builder",zs.root,o.key==="learningPath"?"sbx-lp-profile":""].filter(Boolean).join(" "),children:l.jsx(iU,{editorMode:s,onToolbarEvent:e.onToolbarEvent,onContentAdded:e.onContentAdded,onHierarchySaved:e.onHierarchySaved})})}const bg=e=>l.jsx(CU,{onError:e.onError,children:l.jsxs(Zg,{client:yU,children:[l.jsx(SU,{...e}),l.jsx(Yv,{position:"top-right",toastOptions:{duration:3e3,style:{fontFamily:"var(--sbx-font)"}}})]})}),La=Symbol.for("r2wc.reactRender"),If=Symbol.for("r2wc.shouldRender"),Qo=Symbol.for("r2wc.root");function xU(e=""){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function _U(e=""){return e.replace(/-([a-z0-9])/g,function(t){return t[1].toUpperCase()})}var Df={expando:function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:function(){return r},set:function(n){r=n,this[La]()}}),e[La]()}};function wU(e,t,r,n={}){var s={isConnected:"isConnected"in HTMLElement.prototype},o=!1,a=function(){var u=Reflect.construct(HTMLElement,arguments,this.constructor);return typeof n.shadow=="string"?u.attachShadow({mode:n.shadow}):n.shadow&&(console.warn('Specifying the "shadow" option as a boolean is deprecated and will be removed in a future version.'),u.attachShadow({mode:"open"})),u},i=Object.create(HTMLElement.prototype);i.constructor=a;var c=new Proxy(i,{has:function(u,d){return d in e.propTypes||d in i},set:function(u,d,f,m){return o&&(s[d]=!0),typeof d=="symbol"||s[d]||d in u?(e.propTypes&&d in e.propTypes&&Df.expando(m,d,f),Reflect.set(u,d,f,m)):(Df.expando(m,d,f),!0)},getOwnPropertyDescriptor:function(u,d){var f=Reflect.getOwnPropertyDescriptor(u,d);if(f)return f;if(d in e.propTypes)return{configurable:!0,enumerable:!0,writable:!0,value:void 0}}});return a.prototype=c,i.connectedCallback=function(){this[If]=!0,this[La]()},i.disconnectedCallback=function(){typeof r.createRoot=="function"?this[Qo].unmount():r.unmountComponentAtNode(this)},i[La]=function(){if(this[If]===!0){var u={};Object.keys(this).forEach(function(m){s[m]!==!1&&(u[m]=this[m])},this),o=!0;const d=n.shadow?this.shadowRoot:this,f=t.createElement(e,u);typeof r.createRoot=="function"?(this[Qo]||(this[Qo]=r.createRoot(d)),this[Qo].render(f)):r.render(f,d),o=!1}},e.propTypes&&(a.observedAttributes=n.dashStyleAttributes?Object.keys(e.propTypes).map(function(u){return xU(u)}):Object.keys(e.propTypes),i.attributeChangedCallback=function(u,d,f){var m=n.dashStyleAttributes?_U(u):u;this[m]=f}),a}var es={},jf;function TU(){if(jf)return es;jf=1;var e=Hr;if(process.env.NODE_ENV==="production")es.createRoot=e.createRoot,es.hydrateRoot=e.hydrateRoot;else{var t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;es.createRoot=function(r,n){t.usingClientEntryPoint=!0;try{return e.createRoot(r,n)}finally{t.usingClientEntryPoint=!1}},es.hydrateRoot=function(r,n,s){t.usingClientEntryPoint=!0;try{return e.hydrateRoot(r,n,s)}finally{t.usingClientEntryPoint=!1}}}return es}var EU=TU();const kU=Jl(EU);function AU(){if(document.getElementById("sb-ce-react-styles"))return;const e=document.createElement("style");e.id="sb-ce-react-styles",e.textContent="@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');",document.head.insertBefore(e,document.head.firstChild)}function LU(e="sb-collection-editor"){if(AU(),typeof customElements>"u"||customElements.get(e))return;const t=wU(bg,g,kU,{});customElements.define(e,t)}exports.CollectionEditor=bg;exports.registerCollectionEditor=LU;exports.setApiBaseUrl=dp;exports.useEditorStore=Z;exports.useLibraryStore=hg;exports.useTreeStore=ae;