PageSourceSearch

https://hou.la/chunk-XRC2TPDP.js

js hou.la collected 2026-09-25 03:33:21 UTC 66,450 bytes, 8 lines download raw bytes

1import{a as rt}from"./chunk-YGG56LJO.js";import{a as tt,b as xe,c as it,d as nt,e as ot}from"./chunk-R5JX56WN.js";import{a as et}from"./chunk-GIIMJHN6.js";import{a as Qe,b as Je}from"./chunk-URVIZL7P.js";import{a as Ze}from"./chunk-JS6LICOA.js";import{D as F,a as se,c as ce,g as de,l as pe,o as qe,t as Ge,u as Ke,v as Ye,z as Xe}from"./chunk-FOJCKIWO.js";import{a as le}from"./chunk-AB6CKZTE.js";import"./chunk-AERMLNF3.js";import"./chunk-CV2ZWZQE.js";import"./chunk-H4HD3LNW.js";import"./chunk-AQEWHUN5.js";import{d as W,e as $}from"./chunk-YQZAETCE.js";import{r as ze,s as je,x as He}from"./chunk-EO42E46J.js";import{c as Ne,h as H}from"./chunk-3QVSKJ3X.js";import{C as $e,G as Fe,I as N,c as ae,s as We}from"./chunk-ERUCNOOT.js";import{$b as w,Ba as x,Cc as Ve,Dc as Ae,Ec as Be,F as Ce,Fa as J,Fc as ne,Gc as Re,H as Y,Hc as z,Ib as L,Ic as oe,Jb as S,Kb as De,Lb as U,Nb as Ee,Qb as h,Qc as d,Rb as ee,Rc as _,Sb as ve,Sc as V,Tb as M,U as ye,Ub as I,Vb as a,Wb as l,Xb as O,Y as X,Z as Q,_a as B,bb as Z,da as D,db as r,f as G,fc as C,fd as re,gc as p,l as he,la as g,ma as f,mc as Me,nc as Ie,oc as Le,p as K,s as ke,sb as R,sc as te,tc as c,uc as P,va as Ue,vc as m,wc as ie,yb as b}from"./chunk-DBE7WQEG.js";import{g as k}from"./chunk-W7GRJBO5.js";var _e=class i{http=D(H);hashtags(t,e=8){return this.http.get("/api/search/hashtags",{params:{q:t||"",limit:String(e)}}).pipe(ke(n=>n.items??[]),Ce(()=>he([])))}mentions(t){return this.http.get("/api/content/mention-suggestions",{params:{q:t||""}}).pipe(Ce(()=>he([])))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Q({token:i,factory:i.\u0275fac,providedIn:"root"})};function at(i){return`@[${i.name}](${i.slug})`}function lt(i){let t=i??"",e=[],n=/@\[([^\]]+)\]\(([^)]*)\)|#([\p{L}\p{N}_-]+)/gu,o=0;for(let s of t.matchAll(n)){let u=s.index??0;u>o&&e.push({t:t.slice(o,u)}),e.push(s[1]!==void 0?{t:`@${s[1]}`,kind:"mention"}:{t:`#${s[3]}`,kind:"hashtag"}),o=u+s[0].length}return o<t.length&&e.push({t:t.slice(o)}),e}var ft=["ta"],ht=(i,t)=>t.tag,Ct=(i,t)=>t.id;function vt(i,t){if(i&1){let e=w();a(0,"li",10),C("mousedown",function(){let o=g(e).$index,s=p(2);return f(s.pick(o))}),a(1,"span",11),c(2),l(),a(3,"span",12),c(4),l()()}if(i&2){let e=t.$implicit,n=t.$index,o=p(2);U("is-active",o.highlight()===n),L("aria-selected",o.highlight()===n),r(2),m("#",e.tag,""),r(2),P(e.videoCount)}}function xt(i,t){if(i&1&&(a(0,"ul",3),M(1,vt,5,5,"li",9,ht),l()),i&2){let e=p();r(),I(e.hashtags())}}function bt(i,t){if(i&1&&O(0,"img",13),i&2){let e=p().$implicit;S("src",e.avatarUrl,B)}}function Pt(i,t){i&1&&(a(0,"span",14),O(1,"i",19),l())}function Ot(i,t){i&1&&(a(0,"span",18),c(1),d(2,"translate"),l()),i&2&&(r(),P(_(2,1,"STUDIO.UPLOAD.MENTION_FRIEND")))}function wt(i,t){if(i&1){let e=w();a(0,"li",10),C("mousedown",function(){let o=g(e).$index,s=p(2);return f(s.pick(o))}),b(1,bt,1,1,"img",13)(2,Pt,2,0,"span",14),a(3,"span",15)(4,"span",16),c(5),l(),a(6,"span",17),c(7),l()(),b(8,Ot,3,3,"span",18),l()}if(i&2){let e=t.$implicit,n=t.$index,o=p(2);U("is-active",o.highlight()===n),L("aria-selected",o.highlight()===n),r(),h(e.avatarUrl?1:2),r(4),P(e.name),r(2),m("@",e.slug,""),r(),h(e.relation==="friend"?8:-1)}}function St(i,t){if(i&1&&(a(0,"ul",3),M(1,wt,9,7,"li",9,Ct),l()),i&2){let e=p();r(),I(e.mentions())}}function Tt(i,t){if(i&1&&(a(0,"span",23),c(1),l()),i&2){let e=p().$implicit;Ee("is-"+e.kind),r(),P(e.t)}}function kt(i,t){if(i&1&&(a(0,"span"),c(1),l()),i&2){let e=p().$implicit;r(),P(e.t)}}function yt(i,t){if(i&1&&b(0,Tt,2,3,"span",22)(1,kt,2,1,"span"),i&2){let e=t.$implicit;h(e.kind?0:1)}}function Ut(i,t){if(i&1&&(a(0,"p",8)(1,"span",20),c(2),d(3,"translate"),l(),a(4,"span",21),M(5,yt,2,1,null,null,ee),l()()),i&2){let e=p();r(2),P(_(3,1,"STUDIO.UPLOAD.PREVIEW")),r(3),I(e.previewTokens)}}var ue=class i{suggest=D(_e);maxLength=2200;placeholder="";rows=5;textarea;value="";mode=x(null);hashtags=x([]);mentions=x([]);highlight=x(0);tokenStart=-1;tokenEnd=-1;query$=new G;onChange=()=>{};onTouched=()=>{};constructor(){this.query$.pipe(Y(220),ye(({mode:t,q:e})=>t==="hashtag"?this.suggest.hashtags(e):this.suggest.mentions(e))).subscribe(t=>{this.mode()==="hashtag"?this.hashtags.set(t):this.mentions.set(t),this.highlight.set(0)})}writeValue(t){this.value=t??""}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}get left(){return this.maxLength-(this.value?.length??0)}get used(){return this.value?.length??0}get previewTokens(){return lt(this.value)}get hasMarkup(){return/@\[[^\]]+\]\([^)]*\)/.test(this.value??"")}onInput(t){let e=t.target;this.value=e.value,this.onChange(this.value),this.detectToken(e)}detectToken(t){let e=t.selectionStart??0,n=this.value.slice(0,e),o=/([#@])([^\s#@\]()]*)$/.exec(n);if(!o){this.close();return}this.tokenStart=e-o[0].length,this.tokenEnd=e;let s=o[1]==="#"?"hashtag":"mention";this.mode.set(s),this.query$.next({mode:s,q:o[2]})}onKeydown(t){if(!this.mode())return;let e=this.mode()==="hashtag"?this.hashtags():this.mentions();e.length&&(t.key==="ArrowDown"?(t.preventDefault(),this.highlight.set((this.highlight()+1)%e.length)):t.key==="ArrowUp"?(t.preventDefault(),this.highlight.set((this.highlight()-1+e.length)%e.length)):t.key==="Enter"||t.key==="Tab"?(t.preventDefault(),this.pick(this.highlight())):t.key==="Escape"&&this.close())}pick(t){let e=this.mode();if(!e)return;let n="";if(e==="hashtag"){let u=this.hashtags()[t];if(!u)return;n=`#${u.tag} `}else{let u=this.mentions()[t];if(!u)return;n=`${at(u)} `}let o=this.value.slice(0,this.tokenStart),s=this.value.slice(this.tokenEnd);this.value=`${o}${n}${s}`,this.onChange(this.value),this.close(),queueMicrotask(()=>{let u=this.textarea?.nativeElement;if(!u)return;let v=o.length+n.length;u.focus(),u.setSelectionRange(v,v)})}close(){this.mode.set(null),this.hashtags.set([]),this.mentions.set([]),this.tokenStart=-1,this.tokenEnd=-1}onBlur(){this.onTouched(),setTimeout(()=>this.close(),150)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-widget-content-description"]],viewQuery:function(e,n){if(e&1&&Me(ft,5),e&2){let o;Ie(o=Le())&&(n.textarea=o.first)}},inputs:{maxLength:"maxLength",placeholder:"placeholder",rows:"rows"},features:[ne([{provide:se,useExisting:X(()=>i),multi:!0}])],decls:14,vars:14,consts:[["ta",""],[1,"cd"],[1,"cd__input",3,"input","keydown","blur","click","rows","value","placeholder"],["role","listbox",1,"cd__list"],[1,"cd__footer"],[1,"cd__hint"],[1,"cd__counter"],[1,"cd__counter-max"],[1,"cd__preview"],["role","option",1,"cd__item",3,"is-active"],["role","option",1,"cd__item",3,"mousedown"],[1,"cd__tag"],[1,"cd__count"],["alt","",1,"cd__avatar",3,"src"],[1,"cd__avatar","cd__avatar--empty"],[1,"cd__who"],[1,"cd__name"],[1,"cd__slug"],[1,"cd__badge"],[1,"pi","pi-user"],[1,"cd__preview-label"],[1,"cd__preview-body"],[1,"cd__token",3,"class"],[1,"cd__token"]],template:function(e,n){if(e&1){let o=w();a(0,"div",1)(1,"textarea",2,0),C("input",function(u){return g(o),f(n.onInput(u))})("keydown",function(u){return g(o),f(n.onKeydown(u))})("blur",function(){return g(o),f(n.onBlur())})("click",function(u){return g(o),f(n.onInput(u))}),l(),b(3,xt,3,0,"ul",3)(4,St,3,0,"ul",3),a(5,"div",4)(6,"span",5),c(7),d(8,"translate"),l(),a(9,"span",6),c(10),a(11,"span",7),c(12),l(
1)()(),b(13,Ut,7,3,"p",8),l()}e&2&&(r(),S("rows",n.rows)("value",n.value)("placeholder",n.placeholder),L("maxlength",n.maxLength),r(2),h(n.mode()==="hashtag"&&n.hashtags().length?3:-1),r(),h(n.mode()==="mention"&&n.mentions().length?4:-1),r(3),P(_(8,12,"STUDIO.UPLOAD.DESCRIPTION_HINT")),r(2),U("is-low",n.left<100),r(),P(n.used),r(2),m("/",n.maxLength,""),r(),h(n.hasMarkup?13:-1))},dependencies:[N,F,$,W],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;--accent: #2f8eef;--ink: #14141f;--ink-soft: #5a5a6b;--line: #e7e7ee;--danger: #d8384f}*[_ngcontent-%COMP%]{box-sizing:border-box}.cd[_ngcontent-%COMP%]{position:relative}.cd__input[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);border-radius:10px;padding:.6rem .75rem;font-size:.92rem;line-height:1.45;color:var(--ink);background:#fff;outline:none;resize:vertical;min-height:110px;font-family:inherit}.cd__input[_ngcontent-%COMP%]:focus{border-color:var(--accent);box-shadow:0 0 0 3px #2f8eef24}.cd__list[_ngcontent-%COMP%]{position:absolute;z-index:20;left:0;right:0;margin:.25rem 0 0;padding:.25rem;list-style:none;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 28px #14141f24;max-height:240px;overflow-y:auto}.cd__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.55rem;padding:.45rem .55rem;border-radius:7px;cursor:pointer;font-size:.88rem;color:var(--ink)}.cd__item[_ngcontent-%COMP%]:hover, .cd__item.is-active[_ngcontent-%COMP%]{background:#2f8eef17}.cd__tag[_ngcontent-%COMP%]{font-weight:600;color:var(--accent)}.cd__count[_ngcontent-%COMP%]{margin-left:auto;font-size:.75rem;color:var(--ink-soft)}.cd__avatar[_ngcontent-%COMP%]{width:26px;height:26px;border-radius:50%;object-fit:cover;flex:0 0 auto;background:#f1f1f6}.cd__avatar--empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:var(--ink-soft);font-size:.75rem}.cd__who[_ngcontent-%COMP%]{display:flex;flex-direction:column;line-height:1.2;min-width:0}.cd__name[_ngcontent-%COMP%]{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cd__slug[_ngcontent-%COMP%]{font-size:.75rem;color:var(--ink-soft)}.cd__badge[_ngcontent-%COMP%]{margin-left:auto;font-size:.68rem;font-weight:600;color:var(--accent);background:#2f8eef1a;border-radius:99px;padding:.1rem .45rem}.cd__footer[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-top:.25rem}.cd__hint[_ngcontent-%COMP%], .cd__counter[_ngcontent-%COMP%]{font-size:.75rem;color:var(--ink-soft)}.cd__counter[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;white-space:nowrap}.cd__counter-max[_ngcontent-%COMP%]{opacity:.55}.cd__counter.is-low[_ngcontent-%COMP%]{color:var(--danger);font-weight:600}.cd__preview[_ngcontent-%COMP%]{margin:.6rem 0 0;padding:.1rem 0 .1rem .7rem;border-left:2px solid var(--line, #e7e7ee);font-size:.84rem;color:var(--ink);line-height:1.5;white-space:pre-wrap;word-break:break-word}.cd__preview-label[_ngcontent-%COMP%]{display:block;font-size:.66rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-soft);margin-bottom:.15rem}.cd__preview-body[_ngcontent-%COMP%]{white-space:pre-wrap}.cd__token[_ngcontent-%COMP%]{font-weight:600}.cd__token.is-mention[_ngcontent-%COMP%], .cd__token.is-hashtag[_ngcontent-%COMP%]{color:var(--accent, #2f8eef)}']})};var Dt=2e3,Et=15,st="https://nominatim.openstreetmap.org",Mt="https://overpass-api.de/api/interpreter",me=class i{http=D(H);search(t,e){return k(this,null,function*(){let n=t.trim();if(n.length<2)return[];let o=yield this.autocomplete(n,e);return o.length?o:this.nominatimSearch(n)})}autocomplete(t,e){return k(this,null,function*(){try{let n={q:t};return e&&(n.lat=String(e.lat),n.lng=String(e.lng)),((yield K(this.http.get(`${le.api}/api/places/autocomplete`,{params:n})))??[]).filter(s=>s.name).map(s=>({name:s.name,placeId:s.placeId||void 0,lat:s.lat,lng:s.lng}))}catch{return[]}})}nominatimSearch(t){return k(this,null,function*(){try{return((yield Oe(`${st}/search`,{q:t,format:"json",addressdetails:"1",limit:"10"}))??[]).map(n=>{let o=n.address??{},s=n.name?.trim()||o.road||o.neighbourhood||o.suburb||we(o)||n.display_name||t,u=we(o);return{name:u&&u!==s?`${s}, ${u}
1`:s,placeId:n.osm_type&&n.osm_id?`osm:${n.osm_type}:${n.osm_id}`:void 0,lat:ct(n.lat),lng:ct(n.lon)}})}catch{return[]}})}reverse(t,e){return k(this,null,function*(){let n=[];try{let o=yield Oe(`${st}/reverse`,{lat:String(t),lon:String(e),format:"json",addressdetails:"1",zoom:"18"}),s=o?.address??{},u=[s.road,s.neighbourhood,s.suburb].filter(y=>!!y),v=we(s);v&&!u.includes(v)&&u.push(v);let T=u.length?u.slice(0,3).join(", "):o?.display_name??"";T&&n.push({name:T,lat:t,lng:e}),v&&v!==T&&n.push({name:v,lat:t,lng:e})}catch{}return n})}nearbyPois(t,e){return k(this,null,function*(){let n=`(around:${Dt},${t},${e})`,o=`[out:json][timeout:8];
2(
3  node["amenity"]["name"]${n};
4  node["shop"]["name"]${n};
5  node["tourism"]["name"]${n};
6  node["leisure"]["name"]${n};
7);
8out body 30;`;try{return((yield Oe(Mt,{data:o}))?.elements??[]).slice(0,Et).map(u=>{let v=u.tags??{},T=v.name;if(!T)return null;let y=v.amenity||v.shop||v.tourism||v.leisure||"",E=v["addr:city"]||"";return{name:E?`${T}, ${E}`:y?`${T} (${y})`:T,placeId:u.id!=null?String(u.id):void 0,lat:u.lat,lng:u.lon}}).filter(u=>u!==null)}catch{return[]}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Q({token:i,factory:i.\u0275fac,providedIn:"root"})};function Oe(i,t){return k(this,null,function*(){let e=new URLSearchParams(t).toString(),n=yield fetch(`${i}?${e}`,{headers:{Accept:"application/json"}});return n.ok?yield n.json():null})}var we=i=>i.city||i.town||i.village||i.municipality||"",ct=i=>{let t=Number(i);return Number.isFinite(t)?t:void 0};var It=i=>({value:i});function Lt(i,t){let e;return t.name+((e=t.placeId)!==null&&e!==void 0?e:"")}function Vt(i,t){if(i&1){let e=w();a(0,"button",11),d(1,"translate"),C("click",function(){g(e);let o=p();return f(o.clear())}),O(2,"i",12),l()}i&2&&L("aria-label",_(1,1,"STUDIO.UPLOAD.LOC_CLEAR"))}function At(i,t){i&1&&(a(0,"small"),c(1),d(2,"translate"),l()),i&2&&(r(),P(_(2,1,"STUDIO.UPLOAD.LOC_PRECISE")))}function Bt(i,t){if(i&1&&(a(0,"p",8),O(1,"i",13),a(2,"span"),c(3),l(),b(4,At,3,3,"small"),l()),i&2){let e=t;r(3),P(e.name),r(),h(e.lat!=null?4:-1)}}function Rt(i,t){i&1&&(a(0,"p",9),c(1),d(2,"translate"),l()),i&2&&(r(),P(_(2,1,t)))}function Nt(i,t){i&1&&(a(0,"p",14),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.LOC_SEARCHING")," "))}function Wt(i,t){if(i&1){let e=w();a(0,"button",16),C("mousedown",function(){g(e);let o=p(2);return f(o.useTyped())}),O(1,"i",17),a(2,"span"),c(3),d(4,"translate"),l()()}if(i&2){let e=p(2);r(3),P(V(4,1,"STUDIO.UPLOAD.LOC_USE_TYPED",z(4,It,e.query().trim())))}}function $t(i,t){if(i&1){let e=w();a(0,"li")(1,"button",20),C("mousedown",function(){let o=g(e).$implicit,s=p(3);return f(s.pick(o))}),O(2,"i",17),a(3,"span"),c(4),l()()()}if(i&2){let e=t.$implicit;r(4),P(e.name)}}function Ft(i,t){if(i&1&&(a(0,"p",18),c(1),d(2,"translate"),l(),a(3,"ul",19),M(4,$t,5,1,"li",null,Lt),l()),i&2){let e=p(2);r(),P(_(2,1,e.listLabel)),r(3),I(e.visible)}}function zt(i,t){i&1&&(a(0,"p",14),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.LOC_EMPTY")," "))}function jt(i,t){if(i&1&&(a(0,"div",10),b(1,Nt,3,3,"p",14)(2,Wt,5,6,"button",15)(3,Ft,6,3)(4,zt,3,3,"p",14),l()),i&2){let e=p();r(),h(e.searching()?1:-1),r(),h(e.query().trim()&&!e.searching()?2:-1),r(),h(e.visible.length?3:!e.searching()&&!e.query().trim()?4:-1)}}var Ht=350,dt=2,qt=1e4,ge=class i{places=D(me);isBrowser=ae(D(J));placeholder="";maxLength=200;chosen=x(null);query=x("");results=x([]);nearby=x([]);searching=x(!1);locating=x(!1);open=x(!1);geoError=x(null);lastPosition=null;query$=new G;onChange=()=>{};onTouched=()=>{};constructor(){this.query$.pipe(Y(Ht),Ze()).subscribe(t=>void this.runSearch(t))}writeValue(t){this.chosen.set(t??null),this.query.set(t?.name??"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}get visible(){let t=this.query().trim().toLowerCase();return t.length>=dt&&this.results().length?this.results():t?this.nearby().filter(e=>e.name.toLowerCase().includes(t)):this.nearby()}get listLabel(){return this.nearby().length?"STUDIO.UPLOAD.LOC_NEARBY":"STUDIO.UPLOAD.LOC_POPULAR"}onQuery(t){if(this.query.set(t),this.open.set(!0),this.chosen()&&this.chosen().name!==t&&this.clearChoice(),t.trim().length<dt){this.results.set([]),this.searching.set(!1);return}this.searching.set(!0),this.query$.next(t)}runSearch(t){return k(this,null,function*(){try{let e=yield this.places.search(t,this.lastPosition??void 0);this.results.set(e)}finally{this.searching.set(!1)}})}pick(t){this.chosen.set(t),this.query.set(t.name),this.results.set([]),this.open.set(!1),this.onChange(t),this.onTouched()}useTyped(){let t=this.query().trim();t&&this.pick({name:t})}clear(){this.query.set(""),this.results.set([]),this.clearChoice()}clearChoice(){this.chosen.set(null),this.onChange(null)}onFocus(){this.open.set(!0)}onBlur(){this.onTouched(),setTimeout(()=>this.open.set(!1),180)}locate(){return k(this,null,function*(){if(!(!this.isBrowser||this.locating())){if(this.geoError.
8set(null),!navigator.geolocation){this.geoError.set("STUDIO.UPLOAD.LOC_UNSUPPORTED");return}this.locating.set(!0);try{let t=yield this.currentPosition();this.lastPosition=t,this.open.set(!0);let e=yield this.places.reverse(t.lat,t.lng);this.nearby.set(e);let n=yield this.places.nearbyPois(t.lat,t.lng);n.length&&this.nearby.set([...e,...n]),!e.length&&!n.length&&this.geoError.set("STUDIO.UPLOAD.LOC_NO_RESULT")}catch(t){this.geoError.set(Gt(t))}finally{this.locating.set(!1)}}})}currentPosition(){return new Promise((t,e)=>{navigator.geolocation.getCurrentPosition(n=>t({lat:n.coords.latitude,lng:n.coords.longitude}),e,{enableHighAccuracy:!1,timeout:qt})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-widget-location-picker"]],inputs:{placeholder:"placeholder",maxLength:"maxLength"},features:[ne([{provide:se,useExisting:X(()=>i),multi:!0}])],decls:13,vars:20,consts:[[1,"lp"],[1,"lp__row"],[1,"lp__field"],[1,"pi","pi-map-marker","lp__pin"],["type","text","autocomplete","off",1,"lp__input",3,"input","focus","blur","value","placeholder"],["type","button",1,"lp__clear"],["type","button",1,"lp__geo",3,"click","disabled","title"],[1,"pi"],[1,"lp__chosen"],[1,"lp__error"],[1,"lp__panel"],["type","button",1,"lp__clear",3,"click"],[1,"pi","pi-times"],[1,"pi","pi-check-circle"],[1,"lp__status"],["type","button",1,"lp__item","lp__item--free"],["type","button",1,"lp__item","lp__item--free",3,"mousedown"],[1,"pi","pi-map-marker"],[1,"lp__group"],["role","listbox",1,"lp__list"],["type","button","role","option",1,"lp__item",3,"mousedown"]],template:function(e,n){if(e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2),O(3,"i",3),a(4,"input",4),C("input",function(s){return n.onQuery(s.target.value)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),l(),b(5,Vt,3,3,"button",5),l(),a(6,"button",6),d(7,"translate"),d(8,"translate"),C("click",function(){return n.locate()}),O(9,"i",7),l()(),b(10,Bt,5,2,"p",8)(11,Rt,3,3,"p",9)(12,jt,5,3,"div",10),l()),e&2){let o,s;r(4),S("value",n.query())("placeholder",n.placeholder),L("maxlength",n.maxLength),r(),h(n.query()?5:-1),r(),S("disabled",n.locating())("title",_(7,16,"STUDIO.UPLOAD.LOC_NEAR_ME")),L("aria-label",_(8,18,"STUDIO.UPLOAD.LOC_NEAR_ME")),r(3),U("pi-compass",!n.locating())("pi-spin",n.locating())("pi-spinner",n.locating()),r(),h((o=n.chosen())?10:-1,o),r(),h((s=n.geoError())?11:-1,s),r(),h(n.open()?12:-1)}},dependencies:[N,F,$,W],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;position:relative}.lp__row[_ngcontent-%COMP%]{display:flex;align-items:stretch;gap:.5rem}.lp__field[_ngcontent-%COMP%]{position:relative;flex:1;min-width:0;display:flex;align-items:center}.lp__pin[_ngcontent-%COMP%]{position:absolute;left:.75rem;font-size:.9rem;color:var(--ink-soft, #5a5a6b);pointer-events:none}.lp__input[_ngcontent-%COMP%]{width:100%;padding:.6rem 2.1rem .6rem 2.15rem;border:1px solid var(--line, #e7e7ee);border-radius:10px;font:inherit;font-size:.9rem;color:var(--ink, #14141f);background:#fff;outline:none}.lp__input[_ngcontent-%COMP%]:focus{border-color:var(--accent, #2f8eef)}.lp__clear[_ngcontent-%COMP%]{position:absolute;right:.4rem;width:1.6rem;height:1.6rem;border:none;background:none;color:var(--ink-soft, #5a5a6b);border-radius:50%;cursor:pointer}.lp__clear[_ngcontent-%COMP%]:hover{background:#f2f3f8;color:var(--ink, #14141f)}.lp__geo[_ngcontent-%COMP%]{flex:0 0 auto;width:2.6rem;border:1px solid var(--line, #e7e7ee);border-radius:10px;background:#fff;color:var(--accent, #2f8eef);cursor:pointer}.lp__geo[_ngcontent-%COMP%]:hover:not(:disabled){border-color:var(--accent, #2f8eef);background:#f6faff}.lp__geo[_ngcontent-%COMP%]:disabled{opacity:.6;cursor:default}.lp__chosen[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.4rem;margin:.45rem 0 0;font-size:.82rem;color:var(--ink, #14141f)}.lp__chosen[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%]{color:#1f9d55}.lp__chosen[_ngcontent-%COMP%]   small[_ngcontent-%COMP%]{color:var(--ink-soft, #5a5a6b)}.lp__error[_ngcontent-%COMP%]{margin:.45rem 0 0;font-size:.8rem;color:var(--danger, #d8384f)}.lp__panel[_ngcontent-%COMP%]{position:absolute;z-index:30;left:0;right:0;margin-top:.35rem;max-height:17rem;overflow-y:auto;background:#fff;border:1px solid var(--line, #e7e7ee);border-radius:12px;box-shadow:0 12px 28px #14141f1f;padding:.3rem}.lp__group[_ngcontent-%COMP%]{margin:.35rem .55rem .2rem;font-size:.66rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-soft, #5a5a6b)}.lp__status[_ngcontent-%COMP%]{margin:0;padding:.6rem .7rem;font-size:.82rem;color:var(--ink-soft, #5a5a6b)}.lp__list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}.lp__item[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;gap:.55rem;padding:.55rem .7rem;border:none;background:none;border-radius:8px;text-align:left;font:inherit;font-size:.88rem;color:var(--ink, #14141f);cursor:pointer}.lp__item[_ngcontent-%COMP%]:hover{background:#f4f6fc}.lp__item[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%]{color:var(--ink-soft, #5a5a6b);font-size:.85rem}.lp__item--free[_ngcontent-%COMP%]{color:var(--accent, #2f8eef);font-weight:600}.lp__item--free[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%]{color:var(--accent, #2f8eef)}']})};function Gt(i){let t=i?.code;return t===1?"STUDIO.UPLOAD.LOC_DENIED":t===3?"STUDIO.UPLOAD.LOC_TIMEOUT":"STUDIO.UPLOAD.LOC_FAILED"}var pt=i=>({rate:i}),Yt=(i,t)=>t.id;function Xt(i,t){if(i&1&&O(0,"img",4),i&2){let e=p(2);S("src",e.selected.imageUrl,B)}}function Qt(i,t){i&1&&(a(0,"span",5),O(1,"i",11),l())}function Jt(i,t){if(i&1&&c(0),i&2){let e=p(2);m(" ",e.selected.priceLabel," ")}}function Zt(i,t){if(i&1&&(c(0),d(1,"translate")),i&2){let e=p(2);m(" \xB7 ",V(1,1,"STUDIO.UPLOAD.PRODUCT_COMMISSION",z(4,pt,e.selected.commissionRate))," ")}}function ei(i,t){if(i&1){let e=w();a(0,"div",1),b(1,Xt,1,1,"img",4)(2,Qt,2,0,"span",5),a(3,"span",6)(4,"span",7),c(5),l(),a(6,"span",8),b(7,Jt,1,1)(8,Zt,2,6),l()(),a(9,"button",9),d(10,"translate"),C("click",function(){g(e);let o=p();return f(o.clear())}),O(11,"i",10),l()()}if(i&2){let e=p();r(),h(e.selected.imageUrl?1:2),r(4),P(e.selected.title),r(2),h(e.selected.priceLabel?7:-1),r(),h(e.selected.commissionRate!==null?8:-1),r(),L("aria-label",_(10,5,"STUDIO.UPLOAD.PRODUCT_REMOVE"))}}function ti(i,t){if(i&1){let e=w();a(0,"button",12),C("click",function(){g(e);let o=p();return f(o.toggle())}),O(1,"i",13),c(2),d(3,"translate"),l()}i&2&&(r(2),m(" ",_(3,1,"STUDIO.UPLOAD.PRODUCT_ADD")," "))}function ii(i,t){i&1&&(a(0,"p",17),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.PRODUCT_LOADING")," "))}function ni(i,t){if(i&1&&(a(0,"p",17),c(1),d(2,"translate"),l()),i&2){let e=p(2);r(),m(" ",_(2,1,e.tab()==="own"?"STUDIO.UPLOAD.PRODUCT_EMPTY_OWN":"STUDIO.UPLOAD.PRODUCT_EMPTY_MARKET")," ")}}function oi(i,t){if(i&1&&O(0,"img",4),i&2){let e=p().$implicit;S("src",e.imageUrl,B)}}function ri(i,t){i&1&&(a(0,"span",5),O(1,"i",11),l())}function ai(i,t){if(i&1&&c(0),i&2){let e=p().$implicit;m(" ",e.priceLabel," ")}}function li(i,t){if(i&1&&(c(0),d(1,"translate")),i&2){let e=p().$implicit;m(" \xB7 ",V(1,1,"STUDIO.UPLOAD.PRODUCT_COMMISSION",z(4,pt,e.commissionRate))," ")}}function si(i,t){if(i&1){let e=w();a(0,"li")(1,"button",20),C("click",function(){let o=g(e).$implicit,s=p(3);return f(s.pick(o))}),b(2,oi,1,1,"img",4)(3,ri,2,0,"span",5),a(4,"span",6)(5,"span",7),c(6),l(),a(7,"span",8),b(8,ai,1,1)(9,li,2,6),l()()()()}if(i&2){let e=t.$implicit;r(2),h(e.imageUrl?2:3),r(4),P(e.title),r(2),h(e.priceLabel?8:-1),r(),h(e.commissionRate!==null?9:-1)}}function ci(i,t){if(i&1&&(a(0,"ul",18),M(1,si,10,4,"li",null,Yt),l()),i&2){let e=p(2);r(),I(e.items())}}function di(i,t){if(i&1){let e=w();a(0,"div",3)(1,"div",14)(2,"button",15),C("click",function(){g(e);let o=p();return f(o.switchTab("own"))}),c(3),d(4,"translate"),l(),a(5,"button",15),C("click",function(){g(e);let o=p();return f(o.switchTab("market"))}),c(6),d(7,"translate"),l()(),a(8,"input",16),d(9,"translate"),Be("ngModelChange",function(o){g(e);let s=p();return Ae(s.query,o)||(s.query=o),f(o)}),C("keyup.enter",function(){g(e);let o=p();return f(o.search())}),l(),b(10,ii,3,3,"p",17)(11,ni,3,3,"p",17)(12,ci,3,0,"ul",18),a(13,"button",19),C("click",function(){g(e);let o=p();return f(o.toggle())}),c(14),d(15,"translate"),l()()}if(i&2){let e=p();r(2),U("is-active",e.tab()==="own"),r(),m(" ",_(4,10,"STUDIO.UPLOAD.PRODUCT_TAB_OWN")," "),r(2),U("is-active",e.tab()==="market"),r(),m(" ",_(7,12,"STUDIO.UPLOAD.PRODUCT_TAB_MARKET")," "),r(2),Ve("ngModel",e.query),S("placeholder",_(9,14,"STUDIO.UPLOAD.PRODUCT_SEARCH")),r(2),h(e.loading()?10:e.items().length?12:11),r(4),m(" ",_(15,16,"STUDIO.UPLOAD.PRODUCT_CLOSE")," ")}}var fe=class i{shop=D(et);http=D(H);selected=null;selectedChange=new Ue;open=x(!1);tab=x("own");loading=x(!1);query="";own=x([]);market=x([]);items=()=>this.tab()==="own"?this.own():this.market();
8toggle(){return k(this,null,function*(){let t=!this.open();this.open.set(t),t&&!this.own().length&&(yield this.load())})}switchTab(t){return k(this,null,function*(){this.tab.set(t),yield this.load()})}search(){return k(this,null,function*(){yield this.load()})}load(){return k(this,null,function*(){this.loading.set(!0);try{if(this.tab()==="own"){let t=yield this.shop.listProducts({page:1,limit:20,search:this.query||void 0});this.own.set((t?.data??[]).map(e=>this.toPicked(e)))}else{let t=new Ne().set("page",1).set("limit",20);this.query&&(t=t.set("search",this.query));let n=(yield K(this.http.get(`${le.api}/api/marketplace/products`,{params:t})))?.data??[];this.market.set(n.map(o=>o.product??o).filter(o=>!!o.hasAffiliateProgram).map(o=>this.toPicked(o)))}}catch{this.tab()==="own"?this.own.set([]):this.market.set([])}finally{this.loading.set(!1)}})}toPicked(t){let e=t.images,n=t.price,o=t.currency||"EUR";return{id:String(t.id??""),title:String(t.title??t.name??""),imageUrl:t.imageUrl||t.thumbnailUrl||e?.[0]?.url||null,priceLabel:typeof n=="number"?new Intl.NumberFormat(void 0,{style:"currency",currency:o}).format(n/100):null,commissionRate:typeof t.affiliateCommissionRate=="number"?t.affiliateCommissionRate:null}}pick(t){this.selected=t,this.selectedChange.emit(t),this.open.set(!1)}clear(){this.selected=null,this.selectedChange.emit(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-widget-product-picker"]],inputs:{selected:"selected"},outputs:{selectedChange:"selectedChange"},decls:4,vars:2,consts:[[1,"pp"],[1,"pp__selected"],["type","button",1,"pp__open"],[1,"pp__panel"],["alt","",1,"pp__thumb",3,"src"],[1,"pp__thumb","pp__thumb--empty"],[1,"pp__info"],[1,"pp__title"],[1,"pp__meta"],["type","button",1,"pp__clear",3,"click"],[1,"pi","pi-times"],[1,"pi","pi-shopping-bag"],["type","button",1,"pp__open",3,"click"],[1,"pi","pi-shopping-bag","me-2"],["role","tablist",1,"pp__tabs"],["type","button",1,"pp__tab",3,"click"],["type","search",1,"pp__search",3,"ngModelChange","keyup.enter","ngModel","placeholder"],[1,"pp__empty"],[1,"pp__list"],["type","button",1,"pp__close",3,"click"],["type","button",1,"pp__item",3,"click"]],template:function(e,n){e&1&&(a(0,"div",0),b(1,ei,12,7,"div",1)(2,ti,4,3,"button",2)(3,di,16,18,"div",3),l()),e&2&&(r(),h(n.selected?1:2),r(2),h(n.open()?3:-1))},dependencies:[N,F,ce,de,pe,$,W],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;--accent: #2f8eef;--ink: #14141f;--ink-soft: #5a5a6b;--line: #e7e7ee}*[_ngcontent-%COMP%]{box-sizing:border-box}.pp[_ngcontent-%COMP%]{position:relative}.pp__open[_ngcontent-%COMP%]{width:100%;border:1px dashed var(--line);background:#fff;color:var(--ink-soft);border-radius:10px;padding:.65rem .75rem;font-size:.88rem;font-weight:600;cursor:pointer;text-align:left}.pp__open[_ngcontent-%COMP%]:hover{border-color:var(--accent);color:var(--accent)}
8.pp__selected[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;border:1px solid var(--line);border-radius:10px;padding:.5rem .6rem;background:#fff}.pp__thumb[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:8px;object-fit:cover;background:#f1f1f6;flex:0 0 auto}.pp__thumb--empty[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;color:var(--ink-soft)}.pp__info[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;flex:1 1 auto;line-height:1.25}.pp__title[_ngcontent-%COMP%]{font-size:.86rem;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pp__meta[_ngcontent-%COMP%]{font-size:.76rem;color:var(--ink-soft)}.pp__clear[_ngcontent-%COMP%]{border:0;background:transparent;color:var(--ink-soft);cursor:pointer;padding:.25rem;border-radius:6px}.pp__clear[_ngcontent-%COMP%]:hover{background:#f1f1f6;color:var(--ink)}.pp__panel[_ngcontent-%COMP%]{position:absolute;z-index:30;left:0;right:0;margin-top:.35rem;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 14px 32px #14141f29;padding:.6rem}.pp__tabs[_ngcontent-%COMP%]{display:inline-flex;background:#f1f1f6;border-radius:999px;padding:.2rem;margin-bottom:.5rem}.pp__tab[_ngcontent-%COMP%]{border:0;background:transparent;border-radius:999px;padding:.3rem .8rem;font-size:.8rem;font-weight:600;color:var(--ink-soft);cursor:pointer}.pp__tab.is-active[_ngcontent-%COMP%]{background:#fff;color:var(--ink);box-shadow:0 1px 3px #14141f1f}.pp__search[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);border-radius:8px;padding:.45rem .6rem;font-size:.86rem;outline:none;margin-bottom:.45rem}.pp__search[_ngcontent-%COMP%]:focus{border-color:var(--accent)}
8.pp__list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;max-height:260px;overflow-y:auto}.pp__item[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;width:100%;border:0;background:transparent;padding:.4rem;border-radius:8px;cursor:pointer;text-align:left}.pp__item[_ngcontent-%COMP%]:hover{background:#2f8eef14}.pp__empty[_ngcontent-%COMP%]{font-size:.82rem;color:var(--ink-soft);text-align:center;padding:1.2rem .5rem;margin:0}.pp__close[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);background:#fff;border-radius:8px;padding:.4rem;font-size:.82rem;font-weight:600;color:var(--ink);cursor:pointer;margin-top:.4rem}.pp__close[_ngcontent-%COMP%]:hover{border-color:#c9cbd8}']})};var mt=(i,t)=>({max:i,minutes:t}),pi=(i,t)=>({n:i,total:t}),_i=()=>["public","friends","private"],ui=i=>({time:i}),gt=(i,t)=>t.key,mi=(i,t)=>t.value;function gi(i,t){if(i&1&&(a(0,"p",8),O(1,"i",12),c(2),d(3,"translate"),l()),i&2){let e=p();r(2),m(" ",V(3,1,e.fileError(),oe(4,mt,e.maxSizeMb,e.maxDuration/60))," ")}}function fi(i,t){if(i&1){let e=w();a(0,"div",13),O(1,"i",14),a(2,"p",15),c(3),d(4,"translate"),l(),a(5,"p",16),c(6),d(7,"translate"),l(),a(8,"label",17)(9,"input",18),C("change",function(o){g(e);let s=p();return f(s.onFileInput(o))}),l(),c(10),d(11,"translate"),l()()}if(i&2){let e=p();U("is-dragging",e.dragging()),r(3),m(" ",_(4,5,"STUDIO.UPLOAD.DROP_TITLE")," "),r(3),m(" ",V(7,7,"STUDIO.UPLOAD.DROP_HINT",oe(12,mt,e.maxSizeMb,e.maxDuration/60))," "),r(4),m(" ",_(11,10,"STUDIO.UPLOAD.CHOOSE")," ")}}function hi(i,t){i&1&&(a(0,"p",22),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.SCHEDULE_DROPPED")," "))}function Ci(i,t){if(i&1){let e=w();a(0,"div",10),O(1,"i",19),a(2,"h2",20),c(3),d(4,"translate"),l(),a(5,"p",21),c(6),d(7,"translate"),l(),b(8,hi,3,3,"p",22),a(9,"div",23)(10,"button",24),C("click",function(){g(e);let o=p();return f(o.goToContent())}),c(11),d(12,"translate"),l()()()}if(i&2){let e=p();r(),U("pi-check-circle",e.job().phase==="published")("pi-spin",e.job
8().phase==="processing")("pi-spinner",e.job().phase==="processing"),r(2),m(" ",_(4,10,e.job().phase==="published"?"STUDIO.UPLOAD.DONE_TITLE":"STUDIO.UPLOAD.PROCESSING_TITLE")," "),r(3),m(" ",_(7,12,e.job().phase==="published"?"STUDIO.UPLOAD.DONE_TEXT":"STUDIO.UPLOAD.PROCESSING_TEXT")," "),r(2),h(e.job().scheduleDropped?8:-1),r(3),m(" ",_(12,14,"STUDIO.UPLOAD.GO_CONTENT")," ")}}function vi(i,t){i&1&&(a(0,"small",61),c(1),d(2,"translate"),l()),i&2&&(r(),P(_(2,1,"STUDIO.UPLOAD.STEP_DONE")))}function xi(i,t){if(i&1){let e=w();a(0,"button",56),C("click",function(){let o=g(e).$index,s=p(2);return f(s.goToStep(o))}),a(1,"span",57),c(2),l(),a(3,"span",58)(4,"span",59),c(5),d(6,"translate"),l(),a(7,"small",60),c(8),d(9,"translate"),l()(),b(10,vi,3,3,"small",61),l()}if(i&2){let e=t.$implicit,n=t.$index,o=p(2);U("is-active",o.step()===n)("is-filled",o.stepFilled(e.key)),L("aria-current",o.step()===n?"step":null),r(2),P(n+1),r(3),P(_(6,9,e.label)),r(3),P(_(9,11,e.sub)),r(2),h(o.stepFilled(e.key)?10:-1)}}function bi(i,t){if(i&1&&(a(0,"option",67),c(1),d(2,"uppercase"),d(3,"translate"),l()),i&2){let e=t.$implicit;S("value",e),r(),m(" ",_(3,4,"STUDIO.UPLOAD.LANG_"+_(2,2,e))," ")}}function Pi(i,t){if(i&1){let e=w();a(0,"h3",43),c(1),d(2,"translate"),l(),a(3,"label",62),c(4),d(5,"translate"),l(),a(6,"app-widget-content-description",63),d(7,"translate"),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.set("description",o))}),l(),a(8,"label",64),c(9),d(10,"translate"),l(),a(11,"select",65),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.set("videoLanguage",o))}),a(12,"option",66),c(13),d(14,"translate"),l(),M(15,bi,4,6,"option",67,ve),l(),a(17,"h3",43),c(18),d(19,"translate"),l(),a(20,"input",68),d(21,"translate"),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.set("externalLinkUrl",o))}),l(),a(22,"input",69),d(23,"translate"),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.set("externalLinkLabel",o))}),l(),a(24,"label",70),c(25),d(26,"translate"),l(),a(27,"app-widget-location-picker",71),d(28,"translate"),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.onPlacePicked(o))}),l()}if(i&2){let e=p(2);r(),m(" ",_(2,16,"STUDIO.UPLOAD.SECTION_INFO")," "),r(3),P(_(5,18,"STUDIO.UPLOAD.DESCRIPTION")),r(2),S("ngModel",e.d.description)("maxLength",e.descriptionMax)("placeholder",_(7,20,"STUDIO.UPLOAD.DESCRIPTION_PH")),r(3),P(_(10,22,"STUDIO.UPLOAD.LANGUAGE")),r(2),S("ngModel",e.d.videoLanguage),r(2),m(" ",_(14,24,"STUDIO.UPLOAD.LANG_AUTO")," "),r(2),I(e.languages),r(3),m(" ",_(19,26,"STUDIO.UPLOAD.SECTION_LINK")," "),r(2),S("ngModel",e.d.externalLinkUrl)("placeholder",_(21,28,"STUDIO.UPLOAD.LINK_URL_PH")),r(2),S("ngModel",e.d.externalLinkLabel)("placeholder",_(23,30,"STUDIO.UPLOAD.LINK_LABEL_PH")),r(3),P(_(26,32,"STUDIO.UPLOAD.LOCATION")),r(2),S("ngModel",e.place)("placeholder",_(28,34,"STUDIO.UPLOAD.LOCATION_PH"))}}function Oi(i,t){if(i&1&&(a(0,"small",76),c(1),d(2,"translate"),l()),i&2){let e=p().$implicit;r(),P(_(2,1,e.sub))}}function wi(i,t){if(i&1){let e=w();a(0,"div",73)(1,"span",74)(2,"span",75),c(3),d(4,"translate"),l(),b(5,Oi,3,3,"small",76),l(),a(6,"p-inputSwitch",77),d(7,"translate"),C("ngModelChange",function(o){let s=g(e).$implicit,u=p(3);return f(u.set(s.key,o))}),l()()}if(i&2){let e=t.$implicit,n=p(3);r(3),P(_(4,5,e.label)),r(2),h(e.sub?5:-1),r(),S("ngModel",n.d[e.key])("inputId","opt-"+e.key)("ariaLabel",_(7,7,e.label))}}function Si(i,t){if(i&1){let e=w();a(0,"h3",43),c(1),d(2,"translate"),l(),a(3,"app-widget-product-picker",72),C("selectedChange",function(o){g(e);let s=p(2);return f(s.onProductPicked(o))}),l(),a(4,"h3",43),c(5),d(6,"translate"),l(),M(7,wi,8,9,"div",73,gt)}if(i&2){let e=p(2);r(),m(" ",_(2,3,"STUDIO.UPLOAD.SECTION_PRODUCT")," "),r(2),S("selected",e.pinnedProduct()),r(2),m(" ",_(6,5,"STUDIO.UPLOAD.SECTION_OPTIONS")," "),r(2),I(e.optionRows)}}function Ti(i,t){if(i&1){let e=w();a(0,"label",84)(1,"input",85),C("ngModelChange",function(o){g(e);let s=p(3);return f(s.set("visibility",o))}),l(),O(2,"i",19),a(3,"span"),c(4),d(5,"uppercase"),d(6,"translate"),l()()}if(i&2){let e=t.$implicit,n=p(3);U("is-active",n.d.visibility===e),r(),S("value",e)("ngModel",n.d.visibility),r(),U("pi-globe",e==="public")("pi-users",e==="friends")("pi-lock",e==="private"),r(2),P(_(6,13,"STUDIO.UPLOAD.VIS_"+_(5,11,e)))}}function ki(i,t){if(i&1){let e=w();a(0,"button",88),C("click",function(){let o=g(e).$implicit,s=p(4);return f(s.pickSlot(o.value))}),c(1),d(2,"translate"),l()}if(i&2){let e=t.$implicit,n=p(4);U("is-active",n.d.scheduledAt===e.value),r(),m(" ",V(2,3,e.label,z(6,ui,e.t
8ime))," ")}}function yi(i,t){if(i&1){let e=w();a(0,"button",89),C("click",function(){g(e);let o=p(4);return f(o.clearSchedule())}),c(1),d(2,"translate"),l()}i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.SCHEDULE_NOW")," "))}function Ui(i,t){if(i&1&&(a(0,"div",83),M(1,ki,3,8,"button",86,mi),b(3,yi,3,3,"button",87),l()),i&2){let e=p(3);r(),I(e.quickSlots),r(2),h(e.d.scheduledAt?3:-1)}}function Di(i,t){if(i&1&&(a(0,"p",42),c(1),d(2,"translate"),l()),i&2){let e=p(3);r(),m(" ",_(2,1,e.scheduleError())," ")}}function Ei(i,t){i&1&&(a(0,"p",44),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.SCHEDULE_HINT")," "))}function Mi(i,t){if(i&1){let e=w();a(0,"h3",43),c(1),d(2,"translate"),l(),a(3,"p",78),c(4),d(5,"translate"),l(),a(6,"div",79),M(7,Ti,7,15,"label",80,ve),l(),a(9,"label",81),c(10),d(11,"translate"),l(),a(12,"input",82,1),C("ngModelChange",function(o){g(e);let s=p(2);return f(s.set("scheduledAt",o))})("input",function(){g(e);let o=te(13),s=p(2);return f(s.onScheduleInput(o))})("blur",function(){g(e);let o=te(13),s=p(2);return f(s.onScheduleInput(o))}),l(),b(14,Ui,4,1,"div",83)(15,Di,3,3,"p",42)(16,Ei,3,3,"p",44)}if(i&2){let e=p(2);r(),m(" ",_(2,9,"STUDIO.UPLOAD.SECTION_PRIVACY")," "),r(3),m(" ",_(5,11,"STUDIO.UPLOAD.WHO_CAN_SEE")," "),r(3),I(Re(15,_i)),r(3),P(_(11,13,"STUDIO.UPLOAD.SCHEDULE")),r(2),U("is-invalid",e.scheduleError()),S("min",e.minSchedule)("ngModel",e.d.scheduledAt),r(2),h(e.quickSlots.length||e.d.scheduledAt?14:-1),r(),h(e.scheduleError()?15:16)}}function Ii(i,t){if(i&1){let e=w();a(0,"button",53),C("click",function(){g(e);let o=p(2);return f(o.goToStep(o.step()+1))}),c(1),d(2,"translate"),l()}i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.STEP_NEXT")," "))}function Li(i,t){if(i&1){let e=w();a(0,"img",92),d(1,"translate"),C("click",function(){g(e);let o=p(3);return f(o.showPlayer.set(!0))}),l()}if(i&2){let e=p(3);S("src",e.coverPreview(),B)("title",_(1,2,"STUDIO.UPLOAD.COVER_SHOW_VIDEO"))}}function Vi(i,t){if(i&1&&(O(0,"video",90),b(1,Li,2,4,"img",91)),i&2){let e=p(2);S("src",e.previewUrl(),B),r(),h(e.coverPreview()&&!e.showPlayer()?1:-1)}}function Ai(i,t){if(i&1&&(c(0),d(1,"translate"),d(2,"number")),i&2){let e=p(2);ie(" ",_(1,2,"STUDIO.UPLOAD.UPLOADING")," \u2014 ",V(2,4,e.job().progress*100,"1.0-0")," % ")}}function Bi(i,t){i&1&&(a(0,"span",41),O(1,"i",93),c(2),d(3,"translate"),l()),i&2&&(r(2),P(_(3,1,"STUDIO.UPLOAD.UPLOADED")))}function Ri(i,t){i&1&&(c(0),d(1,"translate")),i&2&&m(" ",_(1,1,"STUDIO.UPLOAD.SUBMITTING")," ")}function Ni(i,t){if(i&1&&(a(0,"span",42),c(1),d(2,"translate"),l()),i&2){let e=p(2);r(),P(_(2,1,e.job().error))}}function Wi(i,t){i&1&&(a(0,"p",44),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.COVER_BUSY")," "))}function $i(i,t){i&1&&(a(0,"p",44),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.COVER_NONE")," "))}function Fi(i,t){if(i&1){let e=w();a(0,"button",94),C("click",function(){let o=g(e).$index,s=p(2);return f(s.chooseCover(o))}),O(1,"img",95),l()}if(i&2){let e=t.$implicit,n=t.$index,o=p(2);U("is-active",o.selectedCover()===n),L("aria-pressed",o.selectedCover()===n),r(),S("src",e,B)}}function zi(i,t){i&1&&(a(0,"p",44),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.COVER_SCRUB_HINT")," "))}function ji(i,t){if(i&1&&(a(0,"p",42),c(1),d(2,"translate"),l()),i&2){let e=p(2);r(),P(_(2,1,e.coverError()))}}function Hi(i,t){i&1&&(c(0),d(1,"translate")),i&2&&m(" ",_(1,1,"STUDIO.UPLOAD.PUBLISH_WHEN_READY")," ")}function qi(i,t){if(i&1&&(c(0),d(1,"translate")),i&2){let e=p(2);m(" ",_(1,1,e.d.scheduledAt?"STUDIO.UPLOAD.SCHEDULE_BTN":"STUDIO.UPLOAD.PUBLISH")," ")}}function Gi(i,t){i&1&&(a(0,"p",22),c(1),d(2,"translate"),l()),i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.SCHEDULE_DROPPED")," "))}function Ki(i,t){if(i&1){let e=w();a(0,"button",96),C("click",function(){g(e);let o=p(2);return f(o.retry())}),c(1),d(2,"translate"),l()}i&2&&(r(),m(" ",_(2,1,"STUDIO.UPLOAD.RETRY")," "))}function Yi(i,t){if(i&1){let e=w();a(0,"div",11)(1,"div",25)(2,"nav",26),M(3,xi,11,13,"button",27,gt),l(),a(5,"p",28),c(6),d(7,"translate"),d(8,"translate"),l(),b(9,Pi,29,36)(10,Si,9,7)(11,Mi,17,16),a(12,"div",29)(13,"button",30),C("click",function(){g(e);let o=p();return f(o.goToStep(o.step()-1))}),c(14),d(15,"translate"),l(),b(16,Ii,3,3,"button",31),l()(),a(17,"div",32)(18,"div",33),b(19,Vi,2,2),l(),a(20,"div",34)(21,"div",35),c(22),l(),a(23,"div",36),c(24),l()(),a(25,"div",37)(26,"div",38),O(27,"div",39),l(),a(28,"div",40),b(29,Ai,3,7)(30,Bi,4,3,"span",41)(31,Ri,2,3)(32,Ni,3,3,"span",42),l()(),a(33,"h3",43),c(34),d(35,"translate"),l(),b(36,Wi,3,3,"p",44)(37,$i,3,3,"p",44),a(38,"div",45,0),C("pointermove",function(o){g(e);let s=te(39),u=p();return f(u.onStripDrag(o,s))}),M(40,Fi,2,4,"button",46,ee),l(),b(42,zi,3,3,"p",47),a(43,"div",48)(44,"label",49)(45,"input",50),C("change",function(o){g(e);let s=p();return f(s.onCoverFile(o))}),l(),O(46,"i",51),l()(),b(47,ji,3,3,"p",42),a(48,"div",52)(49,"button",53),C("click",function(){g(e);let o=p();return f(o.cancel())}),c(50),d(51,"translate"),l(),a(52,"button",54),C("click",function(){g(e);let o=p();return f(o.publish())}
8),b(53,Hi,2,3)(54,qi,2,3),l()(),b(55,Gi,3,3,"p",22)(56,Ki,3,3,"button",55),l()()}if(i&2){let e=p();r(3),I(e.steps),r(3),ie(" ",V(7,25,"STUDIO.UPLOAD.STEP_OF",oe(36,pi,e.step()+1,e.steps.length))," \u2014 ",_(8,28,"STUDIO.UPLOAD.STEP_FREE_HINT")," "),r(3),h(e.step()===0?9:e.step()===1?10:11),r(4),S("disabled",e.step()===0),r(),m(" ",_(15,30,"STUDIO.UPLOAD.STEP_PREV")," "),r(2),h(e.step()<e.steps.length-1?16:-1),r(3),h(e.previewUrl()?19:-1),r(2),S("title",e.job().fileName),r(),m(" ",e.job().fileName," "),r(2),ie(" ",e.formatSize(e.job().bytesTotal)," \xB7 ",e.formatDuration(e.durationSec())," "),r(3),De("width",e.job().progress*100,"%"),r(2),h(e.job().phase==="uploading"?29:e.job().phase==="awaiting-form"?30:e.job().phase==="submitting"?31:e.job().phase==="failed"?32:-1),r(5),m(" ",_(35,32,"STUDIO.UPLOAD.SECTION_COVER")," "),r(2),h(e.coverBusy()?36:e.coverOptions().length?-1:37),r(2),U("is-busy",e.scrubBusy()),r(2),I(e.coverOptions()),r(2),S("ngIf",e.coverOptions().length),r(5),h(e.coverError()?47:-1),r(3),m(" ",_(51,34,"STUDIO.UPLOAD.CANCEL")," "),r(2),S("disabled",!e.canPublish()||e.job().phase==="submitting"),r(),h(e.job().phase==="uploading"?53:54),r(2),h(e.job().scheduleDropped?55:-1),r(),h(e.job().phase==="failed"&&!e.job().permanent?56:-1)}}function _t(i){return i instanceof HTMLInputElement&&i.type.toLowerCase()==="file"}var ut=class i{queue=D(rt);api=D(ot);router=D(ze);isBrowser=ae(D(J));job=this.queue.job;maxDuration=xe;maxSizeMb=Math.round(tt/1048576);fileError=x(null);previewUrl=x(null);durationSec=x(null);coverOptions=x([]);selectedCover=x(null);coverTimes=x([]);scrubBusy=x(!1);stripFrameCount=20;coverBusy=x(!1);coverError=x(null);coverPreview=re(()=>{let t=this.selectedCover();return t===null?null:this.coverOptions()[t]??null});showPlayer=x(!1);scheduleError=x(null);pinnedProduct=x(null);onProductPicked(t){this.pinnedProduct.set(t)}placeCache=null;placeKey="__init__";get place(){let t=this.d,e=[t.locationName,t.locationPlaceId,t.locationLat,t.locationLng].join("|");return e!==this.placeKey&&(this.placeKey=e,this.placeCache=t.locationName?{name:t.locationName,placeId:t.locationPlaceId||void 0,lat:t.locationLat??void 0,lng:t.locationLng??void 0}:null),this.placeCache}onPlacePicked(t){this.queue.patchDraft({locationName:t?.name??"",locationPlaceId:t?.placeId??"",locationLat:t?.lat??null,locationLng:t?.lng??null})}get d(){return this.queue.draft()}set(t,e){this.queue.patchDraft({[t]:e})}descriptionMax=2200;optionRows=[{key:"allowComments",label:"STUDIO.UPLOAD.ALLOW_COMMENTS"},{key:"allowRemix",label:"STUDIO.UPLOAD.ALLOW_REMIX",sub:"STUDIO.UPLOAD.ALLOW_REMIX_SUB"},{key:"isAiGenerated",label:"STUDIO.UPLOAD.IS_AI",sub:"STUDIO.UPLOAD.IS_AI_SUB"},{key:"isPaidPartnership",label:"STUDIO.UPLOAD.IS_PAID",sub:"STUDIO.UPLOAD.IS_PAID_SUB"}];languages=["fr","en","es","it","de","pt","nl","ja","zh","ar"];steps=[{key:"details",label:"STUDIO.UPLOAD.STEP_DETAILS",sub:"STUDIO.UPLOAD.STEP_DETAILS_SUB"},{key:"interaction",label:"STUDIO.UPLOAD.STEP_INTERACTION",sub:"STUDIO.UPLOAD.STEP_INTERACTION_SUB"},{key:"visibility",label:"STUDIO.UPLOAD.STEP_VISIBILITY",sub:"STUDIO.UPLOAD.STEP_VISIBILITY_SUB"}];step=x(0);goToStep(t){this.step.set(Math.min(Math.max(t,0),this.steps.length-1))}stepFilled(t){let e=this.d;return t==="details"?!!(e.description?.trim()||e.videoLanguage||e.locationName||e.externalLinkUrl):t==="interaction"?!!(this.pinnedProduct()||e.isAiGenerated||e.isPaidPartnership||!e.allowComments||!e.allowRemix):!!(e.visibility!=="public"||e.scheduledAt)}canPublish=re(()=>{let t=this.job().phase;return t==="uploading"||t==="awaiting-form"});isDone=re(()=>["processing","published"].includes(this.job().phase));get descriptionLeft(){return this.descriptionMax-(this.d.description?.length??0)}onFileInput(t){let e=t.target,n=e.files?.[0];n&&this.pick(n),e.value=""}dragging=x(!1);onDragOver(t){_t(t.target)||(t.preventDefault(),t.dataTransfer&&(t.dataTransfer.dropEffect="copy"),this.dragging.set(!0))}onDragLeave(t){t.relatedTarget||this.dragging.set(!1)}onDrop(t){if(_t(t.target))return;t.preventDefault(),this.dragging.set(!1);let e=t.dataTransfer?.files?.[0];if(!e)return;let n=this.job().phase;
8if(n!=="idle"&&n!=="cancelled"){this.fileError.set("STUDIO.UPLOAD.ERR_BUSY");return}this.pick(e)}pick(t){return k(this,null,function*(){if(!this.isBrowser)return;this.fileError.set(null);let e=this.api.validateFile(t);if(e){this.fileError.set(e);return}let n=yield this.api.readDuration(t);if(this.durationSec.set(n),n!==null&&n>xe){this.fileError.set("STUDIO.UPLOAD.ERR_TOO_LONG");return}this.previewUrl.set(URL.createObjectURL(t)),this.queue.start(t),this.buildCoverOptions(t,n)})}buildCoverOptions(t,e){return k(this,null,function*(){if(!this.isBrowser||!e)return;this.coverBusy.set(!0);let n=URL.createObjectURL(t),o=document.createElement("video");o.preload="metadata",o.muted=!0,o.playsInline=!0;try{yield new Promise((y,E)=>{let A=setTimeout(()=>E(new Error("metadata timeout")),15e3);o.onloadedmetadata=()=>{clearTimeout(A),y()},o.onerror=()=>{clearTimeout(A),E(new Error("decode error"))},o.src=n});let s=Math.max(1,Math.min(this.stripFrameCount,Math.floor(e))),u=e/s,v=[],T=[];for(let y=0;y<s;y++){let E=Math.min(u*y,o.duration-.1),A=yield this.seekAndGrab(o,E);A&&(v.push(A),T.push(E))}this.coverTimes.set(T),this.coverOptions.set(v),v.length&&this.chooseCover(0)}catch{this.coverOptions.set([])}finally{o.removeAttribute("src"),o.load(),URL.revokeObjectURL(n),this.coverBusy.set(!1)}})}seekAndGrab(t,e){return new Promise(n=>{let o=setTimeout(()=>n(null),12e3),s=()=>{clearTimeout(o),t.removeEventListener("seeked",s);try{let u=document.createElement("canvas");u.width=720,u.height=1280;let v=u.getContext("2d");if(!v||!t.videoWidth){n(null);return}let T=Math.max(u.width/t.videoWidth,u.height/t.videoHeight),y=t.videoWidth*T,E=t.videoHeight*T;v.drawImage(t,(u.width-y)/2,(u.height-E)/2,y,E),n(u.toDataURL("image/jpeg",.85))}catch{n(null)}};t.addEventListener("seeked",s),t.currentTime=Math.max(0,e)})}chooseCover(t){if(this.selectedCover()===t){this.clearCover();return}this.selectedCover.set(t),this.showPlayer.set(!1);let e=this.coverOptions()[t];e&&this.queue.attachCover(this.dataUrlToBlob(e))}scrubCover(t){return k(this,null,function*(){let e=this.queue.pickedFile,n=this.durationSec();if(!this.isBrowser||!e||!n||this.scrubBusy())return;let o=Math.max(0,Math.min(n-.1,t*n));this.scrubBusy.set(!0);let s=URL.createObjectURL(e),u=document.createElement("video");u.preload="metadata",u.muted=!0,u.playsInline=!0;try{yield new Promise((j,Se)=>{let Te=setTimeout(()=>Se(new Error("timeout")),12e3);u.onloadedmetadata=()=>{clearTimeout(Te),j()},u.onerror=()=>{clearTimeout(Te),Se(new Error("decode"))},u.src=s});let v=yield this.seekAndGrab(u,o);if(!v)return;let T=this.coverTimes(),y=0;for(let j=1;j<T.length;j++)Math.abs(T[j]-o)<Math.abs(T[y]-o)&&(y=j);let E=[...this.coverOptions()],A=[...T];E.length?(E[y]=v,A[y]=o,this.coverOptions.set(E),this.coverTimes.set(A),this.selectedCover.set(y)):(this.coverOptions.set([v]),this.coverTimes.set([o]),this.selectedCover.set(0)),this.showPlayer.set(!1),this.queue.attachCover(this.dataUrlToBlob(v))}catch{}finally{u.removeAttribute("src"),u.load(),URL.revokeObjectURL(s),this.scrubBusy.set(!1)}})}onStripDrag(t,e){if(t.buttons!==1)return;let n=e.getBoundingClientRect();n.width<=0||this.scrubCover((t.clientX-n.left)/n.width)}clearCover(){this.selectedCover.set(null),this.showPlayer.set(!1),this.coverError.set(null),this.queue.detachCover()}onCoverFile(t){let e=t.target,n=e.files?.[0];if(e.value="",!n)return;if(!it.includes(n.type)){this.coverError.set("STUDIO.UPLOAD.ERR_COVER_FORMAT");return}if(n.size>nt){this.coverError.set("STUDIO.UPLOAD.ERR_COVER_TOO_BIG");return}this.coverError.set(null);let o=new FileReader;o.onload=()=>{let s=String(o.result);this.coverOptions.update(u=>[...u,s]),this.chooseCover(this.coverOptions().length-1)},o.onerror=()=>this.coverError.set("STUDIO.UPLOAD.ERR_COVER_READ"),o.readAsDataURL(n)}dataUrlToBlob(t){let[e,n]=t.split(","),o=/:(.*?);/.exec(e)?.[1]||"image/jpeg",s=atob(n),u=new Uint8Array(s.length);for(let v=0;v<s.length;v++)u[v]=s.charCodeAt(v);return new Blob([u],{type:o})}publish(){return k(this,null,function*(){if(!this.canPublish()||!this.validateSchedule())return;yield this.queue.submit({description:this.d.description||void 0,visibility:this.d.visibility,allowComments:this.d.allowComments,allowRemix:this.d.allowRemix,isAiGenerated:this.d.isAiGenerated||void 0,isPaidPartnership:this.d.isPaidPartnership||void 0,videoLanguage:this.d.videoLanguage||void 0,externalLinkUrl:this.d.externalLinkUrl||void 0,externalLinkLabel:this.d.externalLinkLabel||void 0,locationName:this.d.locationName||void 0,locationPlaceId:this.d.locationPlaceId||void 0,locationLat:this.d.locationLat??void 0,locationLng:this.d.locationLng??void 0,pinnedProductId:this.pinnedProduct()?.id||void 0,scheduledAt:this.d.scheduledAt?new Date(this.d.scheduledAt).toISOString():void 0});let t=this.job();(t.phase==="processing"||t.phase==="published")&&!t.scheduleDropped&&this.finishAndLeave()})}finishAndLeave(){this.queue.reset(),this.clearLocalMedia(),this.router.navigate(["/studio","content"])}retry(){this.queue.retry()}cancel(){this.queue.cancel(),this.clearLocalMedia()}goToContent(){this.finishAndLeave()}clearLocalMedia(){let t=this.previewUrl();t&&URL.revokeObjectURL(t),this.previewUrl.set(null),this.coverOptions.set([]),this.selectedCover.set(null),this.durationSec.set(null),this.showPlayer.set(!1),this.coverError.set(null),this.scheduleError.set(null)}static SCHEDULE_LEAD_MS=2*6e4;toLocalInput(t){let e=n=>String(n).padStart(2,"0");return`${t.getFullYear()}-${e(t.getMonth()+1)}-${e(t.getDate())}T${e(t.getHours())}:${e(t.getMinutes())}`}minSchedule=this.toLocalInput(new Date(Date.now()+5*6e4));quickSlots=(()=>{let t=new Date,e=(s,u,v=0)=>{let T=new Date(t);
8return T.setDate(T.getDate()+s),T.setHours(u,v,0,0),T},n=s=>`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`;return[{label:"STUDIO.UPLOAD.SLOT_IN_1H",when:new Date(t.getTime()+36e5)},{label:"STUDIO.UPLOAD.SLOT_TONIGHT",when:e(0,19)},{label:"STUDIO.UPLOAD.SLOT_TOMORROW",when:e(1,12)}].filter(s=>s.when.getTime()>t.getTime()+10*6e4).map(s=>({label:s.label,time:n(s.when),value:this.toLocalInput(s.when)}))})();pickSlot(t){this.set("scheduledAt",t),this.scheduleError.set(null)}clearSchedule(){this.set("scheduledAt",""),this.scheduleError.set(null)}onScheduleInput(t){this.scheduleError.set(t.value===""&&t.validity.badInput?"STUDIO.UPLOAD.SCHEDULE_INCOMPLETE":null)}validateSchedule(){if(this.scheduleError()==="STUDIO.UPLOAD.SCHEDULE_INCOMPLETE")return!1;if(!this.d.scheduledAt)return!0;let t=new Date(this.d.scheduledAt).getTime();return!Number.isFinite(t)||t<Date.now()+i.SCHEDULE_LEAD_MS?(this.scheduleError.set("STUDIO.UPLOAD.SCHEDULE_TOO_SOON"),!1):(this.scheduleError.set(null),!0)}formatDuration(t){return t===null?"\u2014":`${Math.floor(t/60)}:${String(Math.floor(t%60)).padStart(2,"0")}`}formatSize(t){return t>=1048576?`${(t/1048576).toFixed(1)} Mo`:`${Math.round(t/1024)} Ko`}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-view-studio-upload"]],hostBindings:function(e,n){e&1&&C("dragover",function(s){return n.onDragOver(s)},!1,Z)("dragleave",function(s){return n.onDragLeave(s)},!1,Z)("drop",function(s){return n.onDrop(s)},!1,Z)},decls:14,vars:8,consts:[["strip",""],["sched",""],[1,"su"],[1,"d-flex","justify-content-between","align-items-center","flex-wrap","gap-3","mb-4"],[1,"text-light","fs-6"],[1,"pi","pi-upload","me-2"],["routerLink","/studio/content",1,"su__back"],[1,"pi","pi-arrow-left","me-1"],[1,"su__error","su__error--top"],[1,"su__drop",3,"is-dragging"],[1,"su__done"],[1,"su__grid"],[1,"pi","pi-exclamation-triangle"],[1,"su__drop"],[1,"pi","pi-cloud-upload","su__drop-icon"],[1,"su__drop-title"],[1,"su__drop-hint"],[1,"su__btn","su__btn--primary"],["type","file","accept","video/mp4,video/quicktime,video/webm","hidden","",3,"change"],[1,"pi"],[1,"su__done-title"],[1,"su__done-text"],[1,"su__warn"],[1,"d-flex","gap-2","justify-content-center","mt-4"],["type","button",1,"su__btn","su__btn--primary",3,"click"],[1,"su__panel"],["aria-label","\xC9tapes",1,"su__steps"],["type","button",1,"su__step",3,"is-active","is-filled"],[1,"su__steps-hint"],[1,"su__steps-nav"],["type","button",1,"su__btn",3,"click","disabled"],["type","button",1,"su__btn"],[1,"su__panel","su__panel--side"],[1,"su__preview"],[1,"su__file"],[1,"su__file-name",3,"title"],[1,"su__file-meta"],[1,"su__progress-wrap"],[1,"su__progress"],[1,"su__progress-bar"],[1,"su__progress-label"],[1,"text-success"],[1,"su__error"],[1,"su__section"],[1,"su__hint"],[1,"su__strip",3,"pointermove"],["type","button",1,"su__cover",3,"is-active"],["class","su__hint",4,"ngIf"],[1,"su__covers"],[1,"su__cover","su__cover--add"],["type","file","accept","image/jpeg,image/png,image/webp","hidden","",3,"change"],[1,"pi","pi-plus"],[1,"su__actions"],["type","button",1,"su__btn",3,"click"],["type","button",1,"su__btn","su__btn--primary",3,"click","disabled"],["type","button",1,"su__btn","mt-2","w-100"],["type","button",1,"su__step",3,"click"],[1,"su__step-num"],[1,"su__step-text"],[1,"su__step-label"],[1,"su__step-sub"],[1,"su__step-done"],[1,"su__label"],[3,"ngModelChange","ngModel","maxLength","placeholder"],["for","lang",1,"su__label","mt-4"],["id","lang",1,"su__input",3,"ngModelChange","ngModel"],["value",""],[3,"value"],["type","url","maxlength","500",1,"su__input","mb-2",3,"ngModelChange","ngModel","placeholder"],["type","text","maxlength","100",1,"su__input",3,"ngModelChange","ngModel","placeholder"],[1,"su__label","mt-4"],[3,"ngModelChange","ngModel","placeholder"],[3,"selectedChange","selected"],[1,"su__switch"],[1,"su__switch-text"],[1,"su__switch-label"],[1,"su__sub"],[3,"ngModelChange","ngModel","inputId","ariaLabel"],[1,"su__sublabel"],[1,"su__radios"],[1,"su__radio",3,"is-active"],["for","sched",1,"su__label","mt-4"],["id","sched","type","datetime-local",1,"su__input",3,"ngModelChange","input","blur","min","ngModel"],[1,"su__slots"],[1,"su__radio"],["type","radio","name","vis","hidden","",3,"ngModelChange","value","ngModel"],["type","button",1,"su__slot",3,"is-active"],["type","button",1,"su__slot","su__slot--clear"],["type","button",1,"su__slot",3,"click"],["type","button",1,"su__slot","su__slot--clear",3,"click"],["controls","","playsinline","",1,"su__video",3,"src"],["alt","",1,"su__preview-cover",3,"src","title"],["alt","",1,"su__preview-cover",3,"click","
8src","title"],[1,"pi","pi-check","me-1"],["type","button",1,"su__cover",3,"click"],["alt","",3,"src"],["type","button",1,"su__btn","mt-2","w-100",3,"click"]],template:function(e,n){e&1&&(a(0,"div",2)(1,"div",3)(2,"span",4),O(3,"i",5),c(4),d(5,"translate"),l(),a(6,"a",6),O(7,"i",7),c(8),d(9,"translate"),l()(),b(10,gi,4,7,"p",8)(11,fi,12,15,"div",9)(12,Ci,13,16,"div",10)(13,Yi,57,39,"div",11),l()),e&2&&(r(4),m(" ",_(5,4,"STUDIO.UPLOAD.TITLE")," "),r(4),m(" ",_(9,6,"STUDIO.UPLOAD.BACK")," "),r(2),h(n.fileError()?10:-1),r(),h(n.job().phase==="idle"||n.job().phase==="cancelled"?11:n.isDone()?12:13))},dependencies:[N,We,$e,Fe,F,Ke,Ye,ce,Ge,qe,de,Xe,pe,He,je,$,W,Je,Qe,ue,fe,ge],styles:['@charset "UTF-8";[_nghost-%COMP%]{display:block;--accent: #2f8eef;--ink: #14141f;--ink-soft: #5a5a6b;--line: #e7e7ee;--danger: #d8384f}*[_ngcontent-%COMP%]{box-sizing:border-box}.su__back[_ngcontent-%COMP%]{color:#cfd3e2;text-decoration:none;font-size:.9rem}.su__back[_ngcontent-%COMP%]:hover{color:#fff}.su__drop[_ngcontent-%COMP%]{background:#fff;border:2px dashed var(--line);border-radius:16px;padding:4rem 2rem;text-align:center;transition:border-color .15s,background .15s}.su__drop[_ngcontent-%COMP%]:hover{border-color:var(--accent);background:#fafbff}.su__drop-icon[_ngcontent-%COMP%]{font-size:3rem;color:var(--accent);display:block;margin-bottom:1rem}.su__drop-title[_ngcontent-%COMP%]{font-size:1.1rem;font-weight:600;color:var(--ink);margin:0 0 .35rem}.su__drop-hint[_ngcontent-%COMP%]{color:var(--ink-soft);font-size:.88rem;margin:0 0 1.5rem}.su__grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 380px;gap:1.25rem;align-items:start}@media (max-width: 980px){.su__grid[_ngcontent-%COMP%]{grid-template-columns:1fr}}.su__panel[_ngcontent-%COMP%]{background:#fff;border:1px solid var(--line);border-radius:14px;padding:1.25rem}.su__panel--side[_ngcontent-%COMP%]{position:sticky;top:1rem}.su__steps[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.4rem;margin-bottom:1rem}.su__step[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;background:#fbfbfe;border:1px solid var(--line);border-left:4px solid var(--line);border-radius:10px;padding:.6rem .8rem;cursor:pointer;transition:border-color .15s ease,background .15s ease}.su__step[_ngcontent-%COMP%]:hover{background:#f4f6fd}.su__step.is-active[_ngcontent-%COMP%]{border-color:var(--accent);border-left-width:6px;background:#fff}.su__step.is-filled[_ngcontent-%COMP%]   .su__step-num[_ngcontent-%COMP%]{background:var(--accent);color:#fff;border-color:var(--accent)}.su__step-num[_ngcontent-%COMP%]{flex:0 0 auto;width:26px;height:26px;border-radius:50%;border:1px solid var(--line);background:#fff;color:var(--ink-soft);font-size:.8rem;font-weight:700;display:inline-flex;align-items:center;justify-content:center}.su__step-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1 1 auto;min-width:0}.su__step-label[_ngcontent-%COMP%]{font-size:.88rem;font-weight:600;color:var(--ink)}.su__step-sub[_ngcontent-%COMP%]{font-size:.75rem;color:var(--ink-soft)}.su__step-done[_ngcontent-%COMP%]{flex:0 0 auto;font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--accent)}.su__steps-hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--ink-soft);margin:0 0 1.25rem}.su__steps-nav[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:space-between;margin-top:1.75rem;padding-top:1rem;border-top:1px solid var(--line)}.su__section[_ngcontent-%COMP%]{font-size:.78rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-soft);margin:2rem 0 .75rem}.su__section[_ngcontent-%COMP%]:first-of-type{margin-top:0}.su__label[_ngcontent-%COMP%]{display:block;font-size:.85rem;font-weight:600;color:var(--ink);margin-bottom:.35rem}.su__hint[_ngcontent-%COMP%]{font-size:.78rem;color:var(--ink-soft);margin:.35rem 0 0}.su__input[_ngcontent-%COMP%]{width:100%;border:1px solid var(--line);border-radius:10px;padding:.6rem .75rem;font-size:.92rem;color:var(--ink);background:#fff;outline:none}.su__input[_ngcontent-%COMP%]:focus{border-color:var(--accent);box-shadow:0 0 0 3px #2f8eef24}.su__textarea[_ngcontent-%COMP%]{resize:vertical;min-height:110px;line-height:1.45}.su__counter[_ngcontent-%COMP%]{text-align:right;font-size:.75rem;color:var(--ink-soft);margin-top:.25rem}.su__counter.is-low[_ngcontent-%COMP%]{color:var(--danger)}.su__radios[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}.su__radio[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:10px;padding:.7rem .5rem;text-align:center;cursor:pointer;font-size:.82rem;color:var(--ink-soft);transition:all .15s}.su__radio[_ngcontent-%COMP%]   i[_ngcontent-%COMP%]{display:block;font-size:1.1rem;margin-bottom:.3rem}.su__radio[_ngcontent-%COMP%]:hover{border-color:#c9cbd8}.su__radio.is-active[_ngcontent-%COMP%]{border-color:var(--accent);background:#2f8eef12;color:var(--accent);font-weight:600}.su__switch[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1.25rem;padding:.55rem 0;font-size:.88rem;color:var(--ink)}.su__switch[_ngcontent-%COMP%] + .su__switch[_ngcontent-%COMP%]{border-top:1px solid var(--line)}.su__switch-text[_ngcontent-%COMP%]{min-width:0}.su__switch-label[_ngcontent-%COMP%]{display:block}.su__preview[_ngcontent-%COMP%]{position:relative;background:#0f0f16;border-radius:12px;overflow:hidden;aspect-ratio:9/16;max-height:320px;margin:0 auto .85rem;display:flex;align-items:center;justify-content:center}.su__preview-cover[_ngcontent-%COMP%]{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#0f0f16;cursor:pointer}.su__video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:contain}
8.su__file-name[_ngcontent-%COMP%]{font-size:.86rem;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.su__file-meta[_ngcontent-%COMP%]{font-size:.78rem;color:var(--ink-soft)}.su__progress-wrap[_ngcontent-%COMP%]{margin:.85rem 0 1.25rem}.su__progress[_ngcontent-%COMP%]{height:6px;background:#eceef6;border-radius:99px;overflow:hidden}.su__progress-bar[_ngcontent-%COMP%]{height:100%;background:var(--accent);border-radius:99px;transition:width .2s ease-out}.su__progress-label[_ngcontent-%COMP%]{font-size:.79rem;color:var(--ink-soft);margin-top:.4rem}.su__covers[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1.1rem}.su__cover[_ngcontent-%COMP%]{width:58px;aspect-ratio:9/16;border-radius:8px;overflow:hidden;border:2px solid transparent;padding:0;background:#f1f1f6;cursor:pointer}.su__cover[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;display:block}.su__cover.is-active[_ngcontent-%COMP%]{border-color:var(--accent)}.su__cover--add[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;border:2px dashed var(--line);color:var(--ink-soft)}.su__cover--add[_ngcontent-%COMP%]:hover{border-color:var(--accent);color:var(--accent)}.su__actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.su__btn[_ngcontent-%COMP%]{border:1px solid var(--line);background:#fff;color:var(--ink);border-radius:10px;padding:.6rem 1.1rem;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .15s}.su__btn[_ngcontent-%COMP%]:hover:not(:disabled){border-color:#c9cbd8}.su__btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.su__btn--primary[_ngcontent-%COMP%]{background:var(--accent);border-color:var(--accent);color:#fff}.su__btn--primary[_ngcontent-%COMP%]:hover:not(:disabled){background:#2578cc;border-color:#2578cc}.su__error[_ngcontent-%COMP%]{color:var(--danger);font-size:.84rem}.su__error--top[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;margin:0 0 1rem;padding:.7rem .9rem;border:1px solid rgba(216,56,79,.35);border-left:3px solid var(--danger);border-radius:8px;background:#fdf2f4;font-size:.88rem;font-weight:500}.su__error--top[_ngcontent-%COMP%]   .pi[_ngcontent-%COMP%]{font-size:1rem;flex:0 0 auto}.su__drop.is-dragging[_ngcontent-%COMP%]{border-color:var(--accent);background:#f2f7ff}.su__warn[_ngcontent-%COMP%]{margin:.6rem 0 0;padding:.5rem .7rem;border-radius:8px;background:#ffb02024;border:1px solid rgba(255,176,32,.4);color:var(--ink);font-size:.82rem}.su__input.is-invalid[_ngcontent-%COMP%]{border-color:var(--danger)}.su__slots[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.5rem}.su__slot[_ngcontent-%COMP%]{border:1px solid var(--line);border-radius:999px;background:#fff;color:var(--ink);font-size:.8rem;padding:.25rem .7rem;cursor:pointer}.su__slot[_ngcontent-%COMP%]:hover{border-color:var(--accent)}.su__slot.is-active[_ngcontent-%COMP%]{border-color:var(--accent);background:#2578cc1a;font-weight:600}.su__slot--clear[_ngcontent-%COMP%]{color:var(--ink-soft)}.su__link-btn[_ngcontent-%COMP%]{display:inline-block;margin-top:.5rem;padding:0;border:0;background:none;color:var(--accent);font-size:.82rem;text-decoration:underline;cursor:pointer}.su__done[_ngcontent-%COMP%]{background:#fff;border:1px solid var(--line);border-radius:16px;padding:3.5rem 2rem;text-align:center}.su__done[_ngcontent-%COMP%] > i[_ngcontent-%COMP%]{font-size:3rem;color:var(--accent);display:block;margin-bottom:1rem}.su__done-title[_ngcontent-%COMP%]{font-size:1.2rem;font-weight:700;color:var(--ink);margin:0 0 .4rem}.su__done-text[_ngcontent-%COMP%]{color:var(--ink-soft);font-size:.9rem;margin:0}.su__sub[_ngcontent-%COMP%]{display:block;font-size:.74rem;color:var(--ink-soft);font-weight:400;line-height:1.35;margin-top:.1rem}.su__sublabel[_ngcontent-%COMP%]{font-size:.82rem;color:var(--ink-soft);margin:0 0 .5rem}.su__strip[_ngcontent-%COMP%]{display:flex;gap:0;overflow-x:auto;border-radius:8px;margin-bottom:.4rem;cursor:ew-resize;touch-action:none;scrollbar-width:thin}.su__strip.is-busy[_ngcontent-%COMP%]{opacity:.75}.su__strip[_ngcontent-%COMP%]   img[_ngcontent-%COMP%]{-webkit-user-drag:none;-webkit-user-select:none;user-select:none;pointer-events:none}.su__strip[_ngcontent-%COMP%]   .su__cover[_ngcontent-%COMP%]{flex:0 0 auto;width:34px;border-radius:0;border:0;box-shadow:none}.su__strip[_ngcontent-%COMP%]   .su__cover.is-active[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 2px var(--accent)}']})};export{ut as ViewStudioUploadComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.