1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[75791],{8401:(e,t,r)=>{r.d(t,{Dr:()=>p,RE:()=>g,vU:()=>f});var i=r(13567),a=r(59373),n=r(45359);let l=e=>{if(e&&"object"==typeof e&&!Array.isArray(e))return e},o=e=>"string"==typeof e?e:void 0,s=e=>"number"==typeof e&&Number.isFinite(e)?e:void 0,u=new Set(["string","integer","number","boolean","array","object"]),d=e=>{let t=l(e),r=o(t?.key)?.trim(),a=o(t?.type)?.trim().toLowerCase();if(!r||!a||!u.has(a))return null;let n=o(t?.item_type)?.trim().toLowerCase(),m=t?.properties,c=Array.isArray(m)?m.map(d).filter(e=>!!e):void 0;return{key:r,description:o(t?.description),type:a,required:t?.required===!0,nullable:t?.nullable===!0,enum:Array.isArray(t?.enum)?t.enum:void 0,minimum:s(t?.minimum),maximum:s(t?.maximum),step:s(t?.step),...("integer"===a||"number"===a)&&void 0!==(0,i.iQ)(t?.auto)?{auto:(0,i.iQ)(t?.auto)}:{},item_type:n,...c?.length?{properties:c}:{}}},m=e=>{let t=d(e),r=l(e),i=o(r?.label)?.trim();return!t||!i||(0,n.nV)({...t,ui:l(r?.ui),choices:l(r?.choices)})?null:{...t,label:i,hidden:r?.hidden===!0||void 0,ui:l(r?.ui),choices:l(r?.choices)}},c=e=>{let t=l(e);return t?{if:l(t.if),then:l(t.then)}:null},p=e=>{let t=l(e)?.promptFields;return Array.isArray(t)?t[0]:void 0},g=e=>{let t,r=l((e=>{if("string"!=typeof e)return e;let t=e.trim();if(!t)return null;try{return JSON.parse(t)}catch{return null}})(e));if(!((t=l(r))&&t.schemaVersion===a.O&&Array.isArray(t.fields)&&l(t.defaults)))return null;let i=r.fields.map(m).filter(e=>!!e);if(r.fields.some(e=>{let t=l(e),r=d(e);return t&&(0,n.nV)({type:r?.type??"",item_type:r?.item_type,enum:r?.enum,ui:l(t.ui),choices:l(t.choices)})}))return null;let s=Array.isArray(r.conditions)?r.conditions.map(c).filter(e=>!!e):void 0;return{schemaVersion:a.O,kind:o(r.kind)?.trim()||void 0,defaults:r.defaults,fields:i,axes:l(r.axes),conditions:s?.length?s:void 0,promptReference:(e=>{let t=l(e);if(t&&"boolean"==typeof t.enabled)return Array.isArray(t.promptFields)&&t.promptFields.length>1?{...t,promptFields:[p(t)]}:t})(r.promptReference)}},f=e=>e.fields},13567:(e,t,r)=>{r.d(t,{TF:()=>n,a6:()=>o,iF:()=>l,iQ:()=>i});let i=e=>{if("auto"===e)return e;if("string"==typeof e&&!e.trim()||"number"!=typeof e&&"string"!=typeof e)return;let t=Number(e);return Number.isFinite(t)?t:void 0},a=e=>Number(e.toPrecision(15)),n=({min:e,max:t,step:r})=>{let i="number"==typeof r&&Number.isFinite(r)&&r>0?r:1;if("number"!=typeof e||!Number.isFinite(e)||"number"!=typeof t||!Number.isFinite(t)||t<e)return{kind:"input",step:i};let n=(t-e)/i;if(!Number.isFinite(n)||e+i===e)return{kind:"input",step:i};let l=Math.floor(n+Math.min(1e-7,Math.abs(n)*Number.EPSILON*8))+1,o=a(e+(l-1)*i);return{kind:l<=6?"select":"slider",min:e,max:o,step:i,count:l}},l=e=>{let t=n(e);return"select"!==t.kind?[]:Array.from({length:t.count},(e,r)=>a(t.min+r*t.step))},o=(e,t)=>{if("number"!=typeof e&&"string"!=typeof e)return;if(void 0!==t.auto&&(e===t.auto||String(e)===String(t.auto)))return t.auto;if("string"==typeof e&&!e.trim())return;let r=Number(e);if(!Number.isFinite(r))return;if(r===t.auto)return r;let i=n(t),l="number"==typeof t.min&&Number.isFinite(t.min)?t.min:void 0,o="number"==typeof t.max&&Number.isFinite(t.max)?t.max:void 0;if(void 0!==l&&void 0!==o&&o<l)return r;let s=Math.min(o??1/0,Math.max(l??-1/0,r));if("input"===i.kind&&void 0===t.step)return s;let u=a((l??0)+Math.round((s-(l??0))/i.step)*i.step);return Math.min("input"===i.kind?o??1/0:i.max,Math.max(l??-1/0,u))}},16064:(e,t,r)=>{r.d(t,{Nu:()=>x,SP:()=>j,_d:()=>k,ep:()=>R,nL:()=>A,wM:()=>I,xY:()=>N});var i=r(93836);let a=/__(string|select|number|integer|boolean|dict|array|text|toggle)(?:__.*)?$/i,n=/_url$/i,l=new Set(["audio","back_image","background_image","body_image","control_image","end_image","face_image","first_frame","first_image","front_image","frontal_image","image","image_input","input_audio","input_image","input_video","last_frame","last_image","left_audio","left_image","mask_image","mask_video","product_image","prompt_audio","reference_audio","reference_image","right_audio","right_image","sample_audio","secondary_source_face","sound","source_face","source_image","start_image","target_face","target_image","target_video","texture_image","video","video_input","voice_sample"]),o=new Set(["clothes_images","element_refer_list","element_video_list","images","input_images","mask_images","refer_images","reference_audios","reference_audio_urls","reference_images","reference_image_urls","reference_urls","reference_videos","reference_video_urls","training_images","training_videos","videos"]),s=new Set(["apply_mask","mask_away_clip","mask_prompt","skip_image_segment"]),u=new Set(["custom_prompt","description","instructions","lyric","lyrics","multi_prompt","negative_prompt","prompt","reference_text","style_instruction","text","voice_description"]),d=new Set(["aspect_ratio","ratio","size","width","height","resolution","media_resolution","target_resolution","resolution_ratio","octree_resolution"]),m=new Set(["batch_size","count","duration","end_time","end_time_relative_to","extend_after_duration","extend_before_duration","face_count","face_limit","image_count","length","max_images","music_length_ms","n","num_frames","num_images","num_outputs","num_samples","num_videos","seconds","start_time","start_time_relative_to","text_count","video_count","audio_count"]),c=new Set(["art_style","audio_mode","audio_setting","audio_type","background","background_color","character_orientation","detail_level","edit_mode","effect","effect_name","effect_scene","emotion","format","genre","geometry_file_format","geometry_quality","language","language_boost","language_type","light_direction","light_type","lighting_direction","material","mode","model","model_mode","model_variant","motion","movement_amplitude","order","orientation","output_compression","output_container_and_codec","output_format","output_language","polygon_type","preset_prompt","quality","quality_and_mesh","reference_type","rendering_speed","shot_type","speed","speed_mode","source_lang","style","style_instruction","symmetry_mode","target_lang","target_language","template","texture","texture_alignment","texture_quality","topology","transitions","transparency","voice","voice_id","voice_language","voice_list","voice_speed"]),p=new Set(["add_subtitle","asmr_mode","auto_size","camera_fixed","enable_audio","enable_image_search","enable_pass2_refinement","enable_pbr","enable_prompt_expansion","enable_safety_checker","enable_timestamps","enable_web_search","face_enhance","force_instrumental","generate_audio","generate_audio_switch","generate_multi_clip_switch","go_fast","instrumental","is_instrumental","keep_original_sound","need_noise_reduction","need_volume_normalization","niji","pbr","prompt_optimizer","quad","remove_background_noise","return_last_frame","should_remesh","should_texture","showcase_toggle","sound_effect_switch","stream","sync_mode","sync_model","tiling_mode","use_original_alpha","use_pe","use_speaker_boost","watermark"]),g=["prompt","negative_prompt","text","custom_prompt","description","instructions","reference_text","structured_prompt","multi_prompt","voice_description","lyric","lyrics","lyrics_prompt","bgm_prompt","texture_prompt","sound_effect_prompt","style_instruction","prompt_extend"],f=["aspect_ratio","ratio","size","width","height","resolution","media_resolution","target_resolution","resolution_ratio","octree_resolution"],_=["batch_size","count","n","max_images","num_images","num_videos","num_outputs","num_samples","num_frames","duration","length","seconds","music_length_ms","extend_before_duration","extend_after_duration","start_time","end_time","start_time_relative_to","end_time_relative_to","face_count","face_limit"],y=["model","model_variant","model_mode","template","style","art_style","quality","quality_and_mesh","mode","reference_type","format","output_format","voice","voice_id","voice_language","voice_speed","voice_list","language","source_lang","target_lang","target_language","output_language","language_type","language_boost","audio_type","audio_mode","audio_setting","genre","emotion","effect","effect_name","effect_scene","shot_type","orientation","character_orientation","motion","movement_amplitude","background","background_color","light_direction","lighting_direction","light_type","material","texture","texture_alignment","texture_quality","geometry_file_format","geometry_quality","rendering_speed","polygon_type","to
1pology","transitions","transparency","speed","speed_mode","order"],h=["generate_audio","generate_audio_switch","generate_multi_clip_switch","enable_audio","sound_effect_switch","enable_timestamps","enable_prompt_expansion","enable_pass2_refinement","enable_pbr","enable_safety_checker","enable_image_search","enable_web_search","go_fast","camera_fixed","face_enhance","force_instrumental","instrumental","is_instrumental","need_noise_reduction","need_volume_normalization","remove_background_noise","keep_original_sound","return_last_frame","use_original_alpha","use_pe","use_speaker_boost","should_remesh","should_texture","prompt_optimizer","niji","tiling_mode","sync_mode","sync_model","watermark","asmr_mode","pbr","quad","showcase_toggle"],b=e=>e&&"object"==typeof e&&!Array.isArray(e)?e:null,v=e=>"string"==typeof e?e.trim().toLowerCase():"",S=e=>b(e.meta)??{},w=(e,t)=>!!(t.exact?.includes(e)||t.patterns?.some(t=>t.test(e))),x=e=>{let t=v(e);return t?t.replace(a,"").replace(n,""):""},I=e=>{let t,r=x(e.id??e.label),i=v(e.type),a=(t=Array.isArray(S(e).accept)?S(e).accept:[],[...Array.isArray(e.accept)?e.accept:"string"==typeof e.accept?[e.accept]:[],...t].map(v).filter(Boolean)),n="boolean"==typeof e.multiple?e.multiple:!0===S(e).multiple,u=a.some(e=>e.startsWith("image/"))?"image":a.some(e=>e.startsWith("audio/"))?"audio":a.some(e=>e.startsWith("video/"))?"video":"other",d=o.has(r),m=l.has(r)||d||("file"===i||"tags"===i||"text"===i)&&"other"!==u,c="other"!==u?u:r.includes("audio")||"bgm"===r||"sound"===r||"prompt_audio"===r||"sample_audio"===r?"audio":r.includes("video")?"video":r.includes("image")||r.includes("frame")||r.includes("face")||r.includes("texture")?"image":"other",p=m||s.has(r)||r.startsWith("mask_");return{canonicalId:r,isResource:m,isResourceRelated:p,resourceKind:m?d||n||"tags"===i?"collection":"single":"none",resourceMedium:c}},k=e=>{let t=x(e.id??e.label);return!!u.has(t)||"mask_prompt"!==t&&t.endsWith("_prompt")},A=e=>{if(k(e))return!0;let t=x(e.label).replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");return/^(?:negative_)?prompt(?:_\d+)?$/.test(t)},F={"resource-single":0,"resource-collection":1,"resource-related":2,prompt:3,shape:4,"count-time":5,quality:6,feature:7,other:8,advanced:9,hidden:10},M=(e,t)=>{let r=t.indexOf(e);return -1===r?Number.MAX_SAFE_INTEGER:r},E=e=>{let t,r=x(e.id??e.label),i=I(e),a=j(e),n="other",l=Number.MAX_SAFE_INTEGER;if("hidden"===a.tier)n="hidden";else if("advanced"===a.tier)n="advanced";else if(i.isResource)n="single"===i.resourceKind?"resource-single":"resource-collection";else if(i.isResourceRelated)n="resource-related";else if(k(e))n="prompt",l=M(r,g);else if(d.has(r))n="shape",l=M(r,f);else if(m.has(r))n="count-time",l=M(r,_);else(c.has(r)||/^speaker(_\d+)?$/.test(r)?0:1)?((e,t)=>{if(p.has(t)||/^(enable|use|is|should|need|keep|preserve|remove|return|add|copy)_/.test(t))return!0;let r=v(e.type);return"boolean"===r||"toggle"===r})(e,r)&&(n="feature",l=M(r,h)):(n="quality",l=M(r,y));return{canonicalId:r,section:n,sectionRank:F[n],explicitOrder:l,typeRank:"text"===(t=v(e.type))||"string"===t?0:"select"===t?1:"number"===t||"integer"===t?2:"boolean"===t||"toggle"===t?3:"file"===t||"tags"===t?4:5}},R=e=>E(e).sectionRank,N=(e,t)=>{let r=E(e),i=E(t);return r.sectionRank!==i.sectionRank?r.sectionRank-i.sectionRank:r.explicitOrder!==i.explicitOrder?r.explicitOrder-i.explicitOrder:r.typeRank!==i.typeRank?r.typeRank-i.typeRank:r.canonicalId.localeCompare(i.canonicalId)},O=[{id:"system-transport-fields",tier:"hidden",group:"system",reason:"System, transport, and provider-internal fields should not render in the public Studio parameter panel.",match:{exact:["channel","extra_body","generationconfig","input_tokens","logit_bias","max_output_tokens","max_tokens","metadata","messages","output_tokens","parallel_tool_calls","raw","response_format","stop","store","stream","stream_options","system","systeminstruction","thinking","thinking_mode","thinking_type","tool_choice","toolconfig","tools","user","web_search"],patterns:[/^cache_read_input_tokens$/,/^enable_(image|web)_search$/,/^reasoning$/,/^reasoning_effort$/]}},{id:"raw-lora-fields",tier:"hidden",group:"system",reason:"Raw LoRA fields stay hidden until Studio has a dedicated LoRA UX, rather than exposing provider-shaped inputs.",match:{exact:["lora","loras","high_noise_loras","low_noise_loras"]}},{id:"hero-core-media",tier:"hero",group:"media",reason:"Resource-like media inputs are the first-class entry point and should render before prompt text and tuning controls.",match:{exact:["audio","image","images","video","mask_image","mask_video","first_frame","first_image","last_frame","last_image","start_image","end_image","source_image","target_image","source_face","target_face","reference_audio","reference_audios","reference_audio_urls","reference_image","reference_images","reference_image_urls","reference_video","reference_videos","reference_video_urls"],patterns:[/^(left|right)_audio$/,/^(left|right|front|back|frontal|body|product|control|texture)_image(s)?$/]}},{id:"priority-prompts",tier:"priority",group:"prompt",reason:"Prompt-like inputs stay near the top, but they should follow primary resource inputs when a task is resource-driven.",match:{exact:["prompt","negative_prompt","text","lyric","lyrics","description","reference_text","voice_description"],patterns:[/(_prompt)$/]}},{id:"priority-output-shape",tier:"priority",group:"output",reason:"Output shape and batch-size decisions are important, but they should not displace primary resource inputs.",match:{exact:["aspect_ratio","ratio","size","resolution","duration","length","n","count","max_images"]}},{id:"priority-model-style",tier:"priority",group:"model",reason:"Model and style selectors are high-value user decisions, but they do not need to displace prompts or media.",match:{exact:["model","model_mode","model_variant","style","template","preset_prompt","quality","mode","format","output_format","media_resolution","target_resolution","resolution_ratio","reference_type","order"]}},{id:"priority-voice-language",tier:"priority",group:"voice",reason:"Voice and language choices are often essential for audio and translation flows and should render early.",match:{exact:["voice","voice_id","voice_language","voice_speed","source_lang","target_lang","target_language","output_language","language","audio_type","audio_mode","audio_setting","speed_mode"],patterns:[/^speaker(_\d+)?$/]}},{id:"advanced-sampling",tier:"advanced",group:"tuning",reason:"Low-level sampling and inference controls belong in advanced parameters.",match:{exact:["accuracy","bitrate","cfg_scale","context_scale","control_guidance_end","control_guidance_start","controlnet_conditioning_scale","creativity","flow_shift","frequency_penalty","guidance_scale","learning_rate","lora_rank","num_inference_steps","presence_penalty","safety_tolerance","sample_rate","seed","similarity","stability","steps","strength","target_megapixels","target_polycount","temperature","top_k","top_p"],patterns:[/(_seed)$/]}}],j=e=>{let t,r,a,n=x(e.id??e.label),l=v(e.type),o=v(S(e).widget),u=(r=b((t=S(e)).xMsChoices)??b(t["x-ms-choices"]),a=b(r?.source),v(a?.resourceId??a?.resource_id??a?.dictKey??a?.dict_key));if((0,i.Ge)(e))return{canonicalId:n,tier:"priority",group:"model",ruleId:"dedicated-lora-array",reason:"Structured LoRA arrays have a dedicated shared editor and should stay in the main visible area."};if("loras"===o||u.includes("lora"))return{canonicalId:n,tier:"hidden",group:"system",ruleId:"resource-lora-fields",reason:"Resource-backed LoRA inputs stay hidden until Studio provides a dedicated LoRA surface."};if(s.has(n))return{canonicalId:n,tier:"standard",group:"media",ruleId:"resource-adjacent-fields",reason:"Mask and resource-adjacent controls stay next to resource inputs instead of being promoted as standalone prompt fields."};for(let e of O)if(w(n,e.match))return{canonicalId:n,tier:e.tier,group:e.group,ruleId:e.id,reason:e.reason};return"selector"===v(S(e)["x-form-schema-role"])?{canonicalId:n,tier:"hidden",group:"system",ruleId:"conditional-selector-fallback",reason:"Selector-only conditional routing fields stay hidden unless they match an explicit user-facing rule."}:"dict"===l||"json"===l?{canonicalId:n,tier:"advanced",group:"system",ruleId:"dict-fallback",reason:"Structured object payloads are advanced by default."}:{canonicalId:n,tier:"standard",group:"number"===l||"integer"===l?"control":"select"===l||"boolean"===l||"toggle"===l?"creative":"control",ruleId:"default-visible-fallback",reason:"Visible user-facing fields default to the standard visible area unless a stronger rule promotes or hides them."}}},26557:(e,t,r)=>{r.d(t,{CF:()=>s,EQ:()=>g,Ir:()=>d,Wj:()=>_,bi:()=>c,fh:()=>f,gh:()=>m});let i=e=>e&&"object"==typeof e&&!Array.isArray(e)?e:null,a=e=>"string"==typeof e?e.trim()||null:"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e?e:null,n=e=>{let t=i(e);if(!t)return;let r=Object.entries(t).reduce((e,[t,r])=>{let i,n=t.trim();if(!n)return e;let l=Array.isArray(r)?r.map(e=>a(e)).filter(e=>null!==e):null===(i=a(r))?[]:[i];return l.length&&(e[n]=l),e},{});return Object.keys(r).length?r:void 0},l=e=>{let t=i(e);return(Array.isArray(t?.rules)?t.rules:[]).map(e=>{let t=i(e),r=i(t?.when),l=Array.isArray(t?.allow)?t.allow.map(e=>a(e)).filter(e=>null!==e).map(e=>
1String(e).trim()).filter(Boolean):[];if(!r||!l.length)return null;let o=n(r),s=Array.isArray(t?.all)?t.all.reduce((e,t)=>{let r=n(i(t)?.when);return r&&Object.assign(e,r),e},{}):void 0,u=Array.isArray(t?.any)?t.any.reduce((e,t)=>{let r=n(i(t)?.when);return r&&Object.assign(e,r),e},{}):void 0;return o||s||u?{...o?{when:o}:{},...s&&Object.keys(s).length?{all:s}:{},...u&&Object.keys(u).length?{any:u}:{},allow:l}:null}).filter(e=>!!e)},o=({rule:e,paramValues:t})=>{let r=(e,r="all")=>{if(!e||0===Object.keys(e).length)return!0;let i=Object.entries(e).map(([e,r])=>{let i=(e=>{if(Array.isArray(e))return e.map(e=>String(e).trim()).filter(Boolean);let t=a(e);return null===t?void 0:t})(t[e]);return void 0!==i&&(Array.isArray(i)?i.some(e=>r.some(t=>String(t).trim()===e)):r.some(e=>String(e).trim()===String(i).trim()))});return"all"===r?i.every(Boolean):i.some(Boolean)};return r(e.when,"all")&&r(e.all,"all")&&r(e.any,"any")},s=({field:e,paramValues:t})=>{let r=i(e.meta?.x),a=l(e.meta?.["x-option-availability"]??r?.["x-option-availability"]);if(!a.length)return e.options;let n=new Set;if(a.forEach(e=>{o({rule:e,paramValues:t})&&e.allow.forEach(e=>n.add(e))}),!n.size)return e.options;let s=e.options.filter(e=>n.has(e.value));return s.length?s:e.options},u=e=>"string"==typeof e?e.trim()||void 0:"number"==typeof e&&Number.isFinite(e)?String(e):"boolean"==typeof e?e?"true":"false":void 0,d=e=>{if(Array.isArray(e))return e.map(e=>u(e)).filter(e=>!!e);let t=u(e);return t?[t]:[]},m=({field:e,value:t,fallbackOptions:r})=>u(t)??(Array.isArray(e.default)?void 0:u(e.default))??r?.[0]?.value??e.options[0]?.value??"",c=e=>!!e.meta?.multiple||Array.isArray(e.default),p=(e,t)=>{if("integer"===t||"number"===t){let t=Number(e);return Number.isFinite(t)?t:e}if("boolean"===t){let t=e.trim().toLowerCase();if("true"===t)return!0;if("false"===t)return!1}return e},g=({value:e,meta:t,multiple:r})=>{let i=t?.valueType,a=t?.itemValueType??i;if(r)return d(e).map(e=>p(e,a));let n=u(e);return void 0===n?e:p(n,i)},f=({schema:e,values:t,modeIds:r})=>{let a=e.flatMap(e=>{if("select"!==e.type||c(e)||null==t[e.id])return[];let r=l(e.meta?.["x-option-availability"]??i(e.meta?.x)?.["x-option-availability"]).filter(e=>[e.when,e.all,e.any].some(e=>e&&"input_mode"in e));return r.length?[{field:e,rules:r}]:[]});if(!a.length)return;let n=r.filter(e=>a.every(({field:r,rules:i})=>{let a=i.filter(r=>o({rule:r,paramValues:{...t,input_mode:e}}));return a.length>0&&a.some(e=>e.allow.includes(String(t[r.id])))}));return 1===n.length?n[0]:void 0},_=({schema:e,values:t,fixedInputMode:r=!0})=>{let a={...t},n=()=>r?a:Object.fromEntries(Object.entries(a).filter(([e])=>"input_mode"!==e)),u=e.flatMap(e=>{if("select"!==e.type||c(e))return[];let t=i(e.meta?.x),a=l(e.meta?.["x-option-availability"]??t?.["x-option-availability"]);if(!a.length)return[];if(r)return[{field:e,rules:a}];let n=a.filter(e=>![e.when,e.all,e.any].some(e=>e&&"input_mode"in e)),o={rules:n.map(e=>({when:e.when??{},allow:e.allow,...e.all?{all:[{when:e.all}]}:{},...e.any?{any:[{when:e.any}]}:{}}))};return[{field:{...e,meta:{...e.meta,"x-option-availability":o,x:{...t,"x-option-availability":o}}},rules:n}]});for(let e=0;e<u.length;e+=1){let e=!1;for(let{field:t,rules:r}of u){let i=n();if(!r.some(e=>o({rule:e,paramValues:i})))continue;let l=s({field:t,paramValues:i});if(1!==l.length)continue;let u=g({value:l[0].value,meta:t.meta,multiple:!1});a[t.id]!==u&&(a[t.id]=u,e=!0)}if(!e)break}let d=new Map(u.map(({field:e})=>[e.id,e]));for(let{field:e,rules:t}of u){let r=n();if(!t.some(e=>o({rule:e,paramValues:r})))continue;let i=s({field:e,paramValues:r});d.set(e.id,{...e,options:i,meta:{...e.meta,disabled:!!e.meta?.disabled||1===i.length}})}return{values:a,schema:e.map(e=>d.get(e.id)??e)}}},36415:(e,t,r)=>{r.d(t,{S:()=>f,g:()=>g});var i=r(13567),a=r(76056),n=r(50996),l=r(26557);let o=e=>{if(!Array.isArray(e))return;let t=e.map(e=>"string"==typeof e?e.trim():"number"==typeof e&&Number.isFinite(e)?String(e):"boolean"==typeof e?e?"true":"false":"").filter(
1Boolean);return t.length?t:[]},s=[["image","first_frame","first_frame_url","first_image","start_image","image_url"],["last_image","last_frame","last_frame_url","end_image"],["images","image_urls","reference_images","reference_image_urls","reference_urls"]],u=new Map([["imgaes",["image","images"]]]),d=({key:e,value:t,schemaById:r})=>{if(r.has(e))return e;let i=u.get(e);if(i){let e=(Array.isArray(t)?[...i].reverse():i).find(e=>r.has(e));if(e)return e}let a=s.find(t=>t.includes(e));return a?a.find(e=>r.has(e))??e:e},m=(e,t)=>{if(null!=t)switch(e.type){case"number":if("auto"===e.auto&&"auto"===t)return"auto";if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t){let e=t.trim();if(!e)return;let r=Number(e);return Number.isFinite(r)?r:void 0}return;case"toggle":let r="boolean"==typeof t?t:void 0;if(void 0!==r)return r;if("string"==typeof t){let e=t.trim().toLowerCase();if("true"===e)return!0;if("false"===e)return!1}if("number"==typeof t&&Number.isFinite(t))return 0!==t;return;case"text":{let e="string"==typeof t?t:void 0;return void 0!==e?e:void 0}case"select":{let r=(0,l.bi)(e),i=new Set(e.options.map(e=>e.value)),a=i.size>0;if(r){let e=[];return Array.isArray(t)?e=o(t)??[]:("string"==typeof t||"number"==typeof t||"boolean"==typeof t)&&(e=[String(t).trim()].filter(e=>e.length>0)),a&&(e=e.filter(e=>i.has(e))),e.length?e:[]}let n="string"==typeof t?t.trim():"number"==typeof t||"boolean"==typeof t?String(t):"";if(n&&a&&!i.has(n))return;return n||void 0}case"file":if((0,a._L)(e)&&Array.isArray(t))return(0,a.rc)(t);if("string"==typeof t)return t.trim()?t.trim():void 0;if(Array.isArray(t)){let e=t.filter(e=>"string"==typeof e&&e.trim().length>0).map(e=>e.trim());return e.length?e:[]}return;case"tags":if(Array.isArray(t))return o(t);return;case"json":if("object"==typeof t)return t;return;default:return}},c=e=>{if(null!=e){if("string"==typeof e||"number"==typeof e&&Number.isFinite(e)||"boolean"==typeof e)return e;if(Array.isArray(e)){let t=e.filter(e=>null!=e);return t.length?t:[]}if("object"==typeof e)return e}},p=({field:e,value:t,ignoreSampleFileDefaults:r})=>{if(!r||!e||"file"!==e.type)return!1;let i="string"==typeof t?[t]:Array.isArray(t)?t:[];return!!i.length&&i.every(e=>"string"==typeof e&&(/^https?:\/\/assets\.musespark\.test\/samples\//i.test(e.trim())||/^(sample|<image_url>|<video_url>|<audio_url>|<file_url>)$/i.test(e.trim())))},g=e=>{let t=e.schema??[],r=!!e.ignoreSampleFileDefaults,i=!1!==e.applyDefaults,a=i?((e,t,r)=>{let i={};for(let a of e)if("default"in a&&void 0!==a.default){if(p({field:a,value:a.default,ignoreSampleFileDefaults:t}))continue;i[a.id]=a.default}else"toggle"===a.type?i[a.id]=!1:r&&"number"===a.type&&(void 0!==a.auto?i[a.id]=a.auto:"number"==typeof a.min&&Number.isFinite(a.min)&&(i[a.id]=a.min));return i})(t,r,!!e.includeNumericDefaults):{},o=new Map(t.map(e=>[e.id,e])),s={...a},u=new Set(Object.keys(e.overrides??{}));if(i){let t=e=>Object.entries((0,n.Dd)(e)).forEach(([e,t])=>{if(!e)return;let i=c(t);if(void 0===i)return;let a=d({key:e,value:i,schemaById:o}),n=o.get(a);if(p({field:n,value:t,ignoreSampleFileDefaults:r}))return;let l=n?m(n,i):i;void 0!==l&&(s[a]=l)});t(e.modelDefaultValuesRaw),t(e.itemDefaultValuesRaw)}return Object.entries(e.overrides??{}).forEach(([e,t])=>{if(!e)return;if(void 0===t){let r=d({key:e,value:t,schemaById:o});delete s[r];return}let r=d({key:e,value:t,schemaById:o}),i=o.get(r),a=i?m(i,t):c(t);void 0!==a&&(s[r]=a)}),i?(({schema:e,merged:t,explicitKeys:r})=>{let i=r??new Set(Object.keys(t));for(let r=0;r<e.length;r+=1){let r=!1;for(let a of e){if("select"!==a.type||(0,l.bi)(a)||i.has(a.id))continue;let e=(0,l.gh)({field:a,value:void 0,fallbackOptions:(0,l.CF)({field:a,paramValues:t})}),n=m(a,e);void 0!==n&&t[a.id]!==n&&(t[a.id]=n,r=!0)}if(!r)break}return t})({schema:t,merged:s,explicitKeys:u}):s},f=({schema:e,values:t,includeHiddenFieldIds:r,passthroughFieldIds:n})=>{if(("input_mode"in t||"__studio_audio_mode"in t)&&(t=Object.fromEntries(Object.entries(t).filter(([e])=>"input_mode"!==e&&"__studio_audio_mode"!==e))),!Object.keys(t).length)return t;if(!e.length){if(!n)return t;
1let e=new Set([...n].filter(Boolean));return Object.fromEntries(Object.entries(t).filter(([t,r])=>e.has(t)&&void 0!==r))}let o=new Map(e.map(e=>[e.id,e])),s=r?new Set([...r].filter(Boolean)):null,u=n?new Set([...n].filter(Boolean)):null;return Object.entries(t).reduce((e,[t,r])=>{let n=u?.has(t)&&!o.has(t)?t:d({key:t,value:r,schemaById:o}),c=o.get(n);if(!c)return u?.has(t)&&void 0!==r&&(e[t]=r),e;if(c.meta?.hidden&&!s?.has(c.id))return e;let p=c.meta?.xMsUi,g=p?.semantic,f=p?.behavior,_=Array.isArray(p?.actions)&&p.actions.some(e=>e&&"object"==typeof e&&"kind"in e&&"randomize"===String(e.kind).trim().toLowerCase()),y="number"===c.type&&void 0===c.auto&&(g?.kind==="seed"||"seed"===c.id||f?.randomSentinel!==void 0||_),h=(0,a._L)(c)?(0,a.vO)(r):"number"!==c.type||y?m(c,r):(0,i.a6)(r,c);return void 0===h||("select"!==c.type?e[n]=h:e[n]=(0,l.EQ)({value:h,meta:c.meta,multiple:(0,l.bi)(c)})),e},{})}},39333:(e,t,r)=>{r.d(t,{NV:()=>p,Vm:()=>m,yc:()=>c});var i=r(16064);let a="x-ms-ui",n="xMsUi",l=e=>e&&"object"==typeof e&&!Array.isArray(e)?e:null,o=e=>JSON.parse(JSON.stringify(e)),s=e=>Array.isArray(e)?[...new Set(e.map(e=>String(e??"").trim()).filter(Boolean))].sort((e,t)=>e.localeCompare(t)):[],u=e=>"hidden-branch"===e.kind?`${e.kind}:${String(e.hiddenBranch?.modeId??"").trim()}`:"companion-resource"===e.kind?`${e.kind}:${String(e.companionResource?.canonicalCarrier??"").trim()}:${String(e.companionResource?.companionRole??"").trim()}`:e.kind,d=e=>{let t=(Array.isArray(e)?e:[e]).map(e=>(e=>{var t,r;let a=l(e);if(!a)return null;let n=String(a.kind??"").trim();if(!["visible-tab","hidden-branch","role-overlay","companion-resource","review-only"].includes(n))return null;let o=l(a.roleOverlay),u=l(a.companionResource),d=l(a.hiddenBranch),m={version:1,kind:n},c=Array.isArray(t=a.visibleModeIds)?[...new Set(t.map(e=>String(e??"").trim()).filter(Boolean))]:[];c.length>0&&(m.visibleModeIds=c);let p=Array.isArray(r=a.visibleModes)?r.map(e=>{let t=l(e);if(!t)return null;let r=String(t.modeId??"").trim();if(!r)return null;let i=String(t.label??"").trim()||void 0,a=s(t.fieldIds),n=String(t.anchorFieldId??"").trim()||void 0,o=s(t.stableFieldIds),u=s(t.clearOnExitFieldIds),d=s(t.retainSharedFieldIds),m={modeId:r};return i&&(m.label=i),a.length>0&&(m.fieldIds=a),Array.isArray(t.requiredFieldIds)&&(m.requiredFieldIds=s(t.requiredFieldIds)),n&&(m.anchorFieldId=n),o.length>0&&(m.stableFieldIds=o),u.length>0&&(m.clearOnExitFieldIds=u),d.length>0&&(m.retainSharedFieldIds=d),m}).filter(e=>!!e):[];if(p.length>0&&(m.visibleModes=p),o){let e=(0,i.Nu)(o.canonicalCarrier),t=(0,i.Nu)(o.resourceRole);e&&t&&(m.roleOverlay={canonicalCarrier:e,resourceRole:t})}if(u){let e=(0,i.Nu)(u.canonicalCarrier),t=(0,i.Nu)(u.companionRole),r=String(u.variant??"").trim().toLowerCase(),a=String(u.groupId??"").trim()||void 0,n=String(u.pairSide??"").trim().toLowerCase()||void 0;e&&t&&(m.companionResource={canonicalCarrier:e,companionRole:t,variant:"single"===r||"collection"===r||"paired"===r?r:void 0,groupId:a,pairSide:n})}if(d){let e=String(d.modeId??"").trim();e&&(m.hiddenBranch={modeId:e,branchType:String(d.branchType??"").trim()||void 0,action:String(d.action??"").trim()||void 0,protocolFieldIds:s(d.protocolFieldIds)})}let g=String(a.reviewReason??"").trim();return g&&(m.reviewReason=g),m})(e)).filter(e=>!!e),r=new Map;return t.forEach(e=>{r.set(u(e),e)}),[...r.values()].sort((e,t)=>u(e).localeCompare(u(t)))},m=(e,t)=>{let r=l(e?.meta),i=l(r?.[n])??l(r?.[a]),o=d(i?.inputModeContract);return t?o.filter(e=>e.kind===t):o},c=(e,t)=>m(e,t)[0]??null,p=({fieldRaw:e,contract:t})=>{let r=o(e),i=l(r.meta),s=i?o(i):{},m=l(s[n]),c=l(s[a]),p=m?o(m):c?o(c):{},g=d(p.inputModeContract),f=u(t),_=[...g.filter(e=>u(e)!==f),o(t)].sort((e,t)=>u(e).localeCompare(u(t)));return p.inputModeContract=1===_.length?_[0]:_,s[n]=o(p),s[a]=p,r.meta=s,r}},42033:(e,t,r)=>{r.d(t,{G:()=>o,My:()=>s,Yw:()=>u});var i=r(76056);let a=e=>Math.max(1,("number"==typeof e.meta?.minItems?e.meta.minItems:void 0)??1),n=e=>Math.max(1,("number"==typeof e.meta?.minLength?e.meta.minLength:void 0)??1),l=e=>e.filter(e=>null!=e&&("string"!=typeof e||e.trim().length>0)).length,o=(e,t)=>{if((0,i._L)(e))return null===(0,i.MA)(t);if(null==t)return!1;switch(e.type){case"text":return"string"==typeof t&&t.trim().length>=n(e);case"select":if("number"==typeof t)return Number.isFinite(t);if("boolean"==typeof t)return!0;
1if("string"==typeof t)return t.trim().length>=n(e);return Array.isArray(t)&&l(t)>=a(e);case"number":if("number"==typeof t)return Number.isFinite(t);if("string"==typeof t)return t.trim().length>0&&Number.isFinite(Number(t));return!1;case"toggle":return"boolean"==typeof t;case"file":if("string"==typeof t)return t.trim().length>0;return Array.isArray(t)&&l(t)>=a(e);case"tags":return Array.isArray(t)&&l(t)>=a(e);case"json":if(Array.isArray(t))return l(t)>=a(e);return"object"==typeof t&&null!==t;default:return!0}},s=({schema:e,values:t})=>e.filter(e=>!e.meta?.hidden&&(e.required||(0,i._L)(e)&&(0,i.vO)(t[e.id]).length>0)).filter(e=>!o(e,t[e.id])).map(e=>({id:e.id,label:(0,i._L)(e)?`${e.label?.trim()||e.id} (${(0,i.MA)(t[e.id])})`:e.label?.trim()||e.id,field:e})),u=e=>{if(0===e.length)return"";let t=e.slice(0,3).map(e=>e.label),r=e.length>t.length?` and ${e.length-t.length} more`:"";return`Please complete required parameter${e.length>1?"s":""}: ${t.join(", ")}${r}.`}},45359:(e,t,r)=>{r.d(t,{Te:()=>a,Ze:()=>n,nV:()=>l});let i=["image","image-big","video","video-big","audio","document","array-image","array-video","array-audio","array-document"],a={image:["image/*"],video:["video/*"],audio:["audio/*"],document:[".pdf",".txt",".md","application/pdf","text/plain","text/markdown"]},n=e=>i.includes(e)?"image-big"===e?{kind:"image",multiple:!1}:"video-big"===e?{kind:"video",multiple:!1}:{kind:e.replace(/^array-/,""),multiple:e.startsWith("array-")}:void 0,l=e=>{let t=n(e.ui?.type);return t?(t.multiple?"array"!==e.type||"string"!==e.item_type:"string"!==e.type)?t.multiple?"requires type=array and item_type=string":"requires type=string":e.enum?.length||Object.keys(e.choices??{}).length?"media UI cannot declare enum or choices":void 0:/^array-(image|video|audio|document)-/.test(e.ui?.type??"")?"unregistered media UI variant":void 0}},67869:(e,t,r)=>{r.d(t,{Ex:()=>w,FU:()=>k,On:()=>_,QP:()=>A,Rv:()=>b});var i=r(39333),a=r(16064);let n=new Map(["image","images","source_image","target_image","front_image","back_image","left_image","right_image","first_frame","last_frame","start_image","end_image","last_image","video","videos","audio","reference_images","reference_videos","reference_audios"].map((e,t)=>[e,t])),l=new Set(["image","images","front_image","back_image","left_image","right_image","first_frame","last_frame","start_image","end_image","last_image","video","videos","audio","reference_images","reference_videos","reference_audios"]),o=new Set(["source_image","target_image"]),s=new Set(["reference_images","reference_videos","reference_audios"]),u={image:"Image",images:"Images",source_image:"Source Image",target_image:"Target Image",front_image:"Front View",back_image:"Back View",left_image:"Left View",right_image:"Right View",first_frame:"First Frame",last_frame:"Last Frame",start_image:"Start Image",end_image:"End Image",last_image:"Last Frame",video:"Video",videos:"Videos",audio:"Audio",reference_images:"Image Reference",reference_videos:"Video Reference",reference_audios:"Audio Reference"},d=new Set(["custom_prompt","description","instructions","lyric","lyrics","multi_prompt","prompt","reference_text","style_instruction","text","voice_description"]),m=(e,t)=>{let r=n.get(e)??Number.MAX_SAFE_INTEGER,i=n.get(t)??Number.MAX_SAFE_INTEGER;return r!==i?r-i:e.localeCompare(t)},c=e=>[...new Set(e)].sort(m),p=e=>[...new Set(e)].sort((e,t)=>e.localeCompare(t)),g=({signatureKeys:e,fieldIds:t,stableFieldIds:r})=>{if(!e.length)return[];let i=[...new Set([...r??[],...t])],a=e.filter(e=>i.some(t=>_(t)===e));return a.length?a:e},f=({signatureKeys:e,displaySignatureKeys:t})=>e.length&&t.length&&!(t.length>=e.length)?t:e,_=e=>{let t=(0,a.Nu)(e);switch(t){case"video_url":return"video";case"image_urls":return"images";case"first_frame_url":case"first_image":return"first_frame";case"last_frame_url":return"last_frame";case"reference_image_urls":return"reference_images";case"reference_video_urls":return"reference_videos";case"reference_audio":case"reference_audio_urls":return"reference_audios";case"video_urls":return"videos";case"frontal_image":return"front_image";default:return t}},y=e=>e&&"object"==typeof e&&!Array.isArray(e)?e:null,h=new Set(["input_mode","inputmode"]),b=({schema:e,modes:t})=>{let r=new Set(t.map(e=>
1_(e.id)).filter(Boolean)),i=new Set(e.map(e=>e.id)),n=e.flatMap(e=>{if("select"!==e.type&&"text"!==e.type)return[];if(e.meta?.schemaDriven){let r=y(y(e.meta.xSchema)?.input_mode);return(r?.field===e.id||!0===e.meta["x-input-mode-selector"])&&t.length&&("select"!==e.type||t.every(t=>e.options.some(e=>e.value===t.id)))?[e.id]:[]}let i=(0,a.Nu)(e.id||e.key||e.label),n=y(e.meta?.x);if(e.meta?.["x-input-mode-selector"]===!0||n?.["x-input-mode-selector"]===!0||h.has(i))return[e.id];if("select"!==e.type||!r.size)return[];let l=e.options.some(e=>r.has(_(e.value))),o=[e.meta?.["x-form-schema-role"],n?.["x-form-schema-role"]].some(e=>"selector"===String(e??"").trim().toLowerCase());return l&&("mode"===i||i.endsWith("_mode")||i.endsWith("_type")||o)?[e.id]:[]});return t.length&&e.forEach(e=>{let t=y(y(e.meta?.xSchema)?.input_mode),r="string"==typeof t?.field?t.field.trim():"";r&&!i.has(r)&&n.push(r)}),[...new Set(n)]},v=e=>l.has(e)||o.has(e),S=(e,t)=>e.length===t.length&&e.every((e,r)=>e===t[r]),w=e=>e.displaySignatureKeys.length?e.displaySignatureKeys:e.signatureKeys,x=e=>{switch(e){case"image":return"Image";case"images":return"Images";case"reference_images":return"Image Reference";case"reference_videos":return"Video Reference";case"reference_audios":return"Audio Reference";default:return u[e]??e}},I=({signatureKeys:e,displaySignatureKeys:t})=>{let r,i,a,n;return e.length>0&&e.every(e=>!v(e))?(r=t.includes("speaker"),i=t.some(e=>/^speaker_\d+$/.test(e)),a=t.includes("text"),n=t.includes("prompt"),r&&a?"Single Speaker":i&&n?"Multi Speaker":t.map(e=>u[e]??e).join(" + ")):(e=>{if(!e.length)return"Text";if(e.every(e=>s.has(e))){if(e.length>=3&&s.size===e.length){let t=new Set(e);if([...s].every(e=>t.has(e)))return"Reference Media"}let t=[];return(e.includes("reference_images")&&t.push("Image"),e.includes("reference_videos")&&t.push("Video"),e.includes("reference_audios")&&t.push("Audio"),t.length)?1===t.length?`${t[0]} Reference`:`${t.join(" + ")} Reference`:"Reference"}if(S(e,["image"]))return"Image";if(S(e,["images"]))return"Images";if(S(e,["first_frame"]))return"First Frame";let t=(e=>{for(let t of[{required:["source_image","target_image"],label:"Image Pair"}]){if(!t.required.every(t=>e.includes(t)))continue;let r=new Set(t.required),i=e.filter(e=>!r.has(e));if(!i.length)return t.label;return[t.label,...i.map(x)].join(" + ")}return null})(e);if(t)return t;let r=(e=>{for(let t of[["back_image","front_image","left_image","right_image"],["back_image","front_image","left_image"]])if(e.length===t.length&&t.every(t=>e.includes(t)))return"Multi View";return null})(e);if(r)return r;let i=(e=>{for(let t of[{required:["image","end_image","last_image"],label:"First + End + Last"},{required:["image","last_image"],label:"First + Last"},{required:["image","end_image"],label:"Start + End"},{required:["first_frame","last_frame"],label:"First + Last"},{required:["start_image","end_image"],label:"Start + End"}]){if(!t.required.every(t=>e.includes(t)))continue;let r=new Set(t.required),i=e.filter(e=>!r.has(e));if(!i.length)return t.label;return[t.label,...i.map(x)].join(" + ")}return null})(e);return i||e.map(x).join(" + ")})(t)},k=(e,t={})=>{let r,n,l=(r=new Map,n=new Map,e.forEach(e=>{(0,i.Vm)(e,"companion-resource").forEach(t=>{let i=_(t.companionResource?.canonicalCarrier),a=_(t.companionResource?.companionRole);if(!i||!a)return;let l=r.get(i)??new Set;l.add(e.id),r.set(i,l);let o=n.get(a)??new Set;o.add(i),n.set(a,o)})}),{fieldIdsByCarrierKey:r,carrierKeysByRoleKey:n}),o=(e=>{let t=new Map;if(e.forEach(e=>{let r=(0,i.yc)(e,"visible-tab");r?.kind!=="visible-tab"||((r.visibleModeIds??[]).forEach(e=>{let r=String(e??"").trim();r&&(t.has(r)||t.set(r,{anchorFieldIds:new Set,labels:new Set,fieldIds:new Set,stableFieldIds:new Set,clearOnExitFieldIds:new Set,retainSharedFieldIds:new Set}))}),Array.isArray(r.visibleModes)&&0!==r.visibleModes.length&&r.visibleModes.forEach(r=>{let i=String(r.modeId??"").trim();if(!i)return;let a=t.get(i)??{anchorFieldIds:new Set,labels:new Set,fieldIds:new Set,stableFieldIds:new Set,clearOnExitFieldIds:new Set,retainSharedFieldIds:new Set},n=String(r.anchorFieldId??"").trim()||String(e.id??"").trim();n&&a.anchorFieldIds.add(n);let l=String(r.label??"").trim();l&&a.labels.add(l),(Array.isArray(r.fieldIds)?r.fieldIds:[]).forEac
1h(e=>a.fieldIds.add(e)),void 0!==r.requiredFieldIds&&(a.requiredFieldIds??=new Set,r.requiredFieldIds.forEach(e=>a.requiredFieldIds.add(e))),(r.stableFieldIds??[]).forEach(e=>a.stableFieldIds.add(e)),(r.clearOnExitFieldIds??[]).forEach(e=>a.clearOnExitFieldIds.add(e)),(r.retainSharedFieldIds??[]).forEach(e=>a.retainSharedFieldIds.add(e)),t.set(i,a)}))}),0===t.size)return null;let r=[...t.entries()].map(([e,t])=>{let r=[...t.fieldIds].sort((e,t)=>e.localeCompare(t)),i=[...t.stableFieldIds].sort((e,t)=>e.localeCompare(t)),n=[...t.anchorFieldIds].sort((e,t)=>e.localeCompare(t)),l=c([...new Set(i.length>0?i:r.length>0?r:n)].map(e=>_(e)).filter(e=>!!e&&!d.has(e)&&v(e))),o=l.length>0?l:"text-only"===e||"text_only"===(0,a.Nu)(e)?[]:c(e.split("__").map(e=>e.trim()).filter(Boolean)),s=g({signatureKeys:o,fieldIds:r,stableFieldIds:i}),u=[...t.labels].find(Boolean);return{id:e,label:u??I({signatureKeys:o,displaySignatureKeys:s}),...u?{labelSource:"schema"}:{},fieldIds:r,...t.requiredFieldIds?{requiredFieldIds:r.filter(e=>t.requiredFieldIds.has(e))}:{},stableFieldIds:i.length>0?i:r.length>0?r:n,signatureKeys:o,displaySignatureKeys:s,clearOnExitFieldIds:[...t.clearOnExitFieldIds].sort((e,t)=>e.localeCompare(t)),retainSharedFieldIds:[...t.retainSharedFieldIds].sort((e,t)=>e.localeCompare(t))}});return{modes:r,modeFieldIds:[...new Set(r.flatMap(e=>e.fieldIds))].sort((e,t)=>e.localeCompare(t))}})(e),s=!0===t.includeSingleMode;if(e.some(e=>e.meta?.schemaDriven===!0)){let t=[...new Set(e.flatMap(e=>(0,i.yc)(e,"visible-tab")?.visibleModeIds??[]))],r=o?.modes.slice().sort((e,r)=>t.indexOf(e.id)-t.indexOf(r.id))??[];return{modes:r.length>1||s?r:[],modeFieldIds:o?.modeFieldIds??[]}}if(o){let t=(({modes:e,companionModeState:t})=>e.length&&0!==t.fieldIdsByCarrierKey.size?e.map(e=>{let r=f({signatureKeys:e.signatureKeys,displaySignatureKeys:e.displaySignatureKeys});if(1!==r.length)return e;let i=r[0];if(!i)return e;let a=p([...e.companionFieldIds??[],...t.fieldIdsByCarrierKey.get(i)??[]]);if(0===a.length)return e;let n=p([...e.fieldIds,...a]),l=p([...e.stableFieldIds??e.fieldIds,...a]),o=e.displaySignatureKeys.length>0&&e.displaySignatureKeys.length<e.signatureKeys.length?e.displaySignatureKeys:g({signatureKeys:e.signatureKeys,fieldIds:n,stableFieldIds:l});return{...e,label:"schema"===e.labelSource?e.label:I({signatureKeys:e.signatureKeys,displaySignatureKeys:o}),fieldIds:n,stableFieldIds:l,companionFieldIds:a,displaySignatureKeys:o}}):e)({modes:o.modes,companionModeState:l});t=(e=>{if(!e.length)return e;let t=new Map;return e.forEach(e=>{let r=f({signatureKeys:e.signatureKeys,displaySignatureKeys:e.displaySignatureKeys}),i="schema"===e.labelSource?e.id:r.length?r.join("__"):"text-only",a=new Set(e.fieldIds),n=new Set(e.stableFieldIds??e.fieldIds),l=new Set(e.companionFieldIds??[]),o=new Set(e.clearOnExitFieldIds??[]),s=new Set(e.retainSharedFieldIds??[]),u=t.get(i);u&&(u.fieldIds.forEach(e=>a.add(e)),(u.stableFieldIds??u.fieldIds).forEach(e=>n.add(e)),(u.companionFieldIds??[]).forEach(e=>l.add(e)),(u.clearOnExitFieldIds??[]).forEach(e=>o.add(e)),(u.retainSharedFieldIds??[]).forEach(e=>s.add(e)));let d=p(a),m=p(n),c=[e.displaySignatureKeys,u?.displaySignatureKeys??[]].filter(e=>e.length>0&&e.length<r.length).sort((e,t)=>e.length-t.length)[0]??null,_=g({signatureKeys:r,fieldIds:d,stableFieldIds:m}),y=c??_,h=p(l),b=p(o),v=p(s),S="schema"===e.labelSource?e.label:u?.labelSource==="schema"?u.label:void 0;t.set(i,{...e,id:i,label:S??I({signatureKeys:r,displaySignatureKeys:y}),...S?{labelSource:"schema"}:{},fieldIds:d,stableFieldIds:m,signatureKeys:r,displaySignatureKeys:y,...h.length>0?{companionFieldIds:h}:{},...b.length>0?{clearOnExitFieldIds:b}:{},...v.length>0?{retainSharedFieldIds:v}:{}})}),[...t.values()]})(t=(({modes:e,companionModeState:t})=>e.length&&0!==t.carrierKeysByRoleKey.size?e.map(e=>{let r=(({signatureKeys:e,companionModeState:t})=>{if(e.length<=1)return null;let r=e.filter(r=>!!e.some(e=>e!==r&&t.carrierKeysByRoleKey.get(e)?.has(r)===!0)&&e.every(e=>e===r||t.carrierKeysByRoleKey.get(e)?.has(r)===!0));return 1!==r.length?null:[r[0]]})({signatureKeys:e.signatureKeys,companionModeState:t});return r?{...e,label:"schema"===e.labelSource?e.label:I({signatureKeys:e.signatureKeys,displaySignatureKeys:r}),displaySignatureKeys:r}:e}):e)({modes:t,companionModeState:l}));let r=e.filter(e=>!e.meta?.hidden&&d.has((0,a.Nu)(e.id))).length>0,i=new Map(t.map(e=>[e.id,r&&(0===e.signatureKeys.length||t.some(e=>0===e.signatureKeys.length))])),n=t.filter(e=>e.signatureKeys.length>0||!0===i.get(e.id)),u=n.some(e=>0===e.signatureKeys.length)&&n.some(e=>e.signatureKeys.length>0&&i.get(e.id))?n.map(e=>{let t=!0===i.get(e.id);return"schema"===e.labelSource?e:0===e.signatureKeys.length?t?{...e,label:"Text Only"}:e:t?{...e,label:`Text + ${e.label}`}:e}):n;return{modes:u.length>=2||s&&1===u.length?u:[],modeFieldIds:p([...o.modeFieldIds,...u.flatMap(e=>e.companionFieldIds??[])])}}return{modes:[],modeFieldIds:[]}},A=({modes:e,paramValues:t})=>{if(!e.length)return null;let r=t??{},i=null,a=0;
1return(e.forEach(e=>{let t=e.fieldIds.reduce((e,t)=>{var i;return e+ +!!(null!=(i=r[t])&&("string"==typeof i?i.trim().length>0:"number"==typeof i?Number.isFinite(i):"boolean"==typeof i?i:Array.isArray(i)?i.length>0:"object"==typeof i&&Object.keys(i).length>0))},0);t>a&&(i=e.id,a=t)}),i)?i:e.find(e=>0===e.signatureKeys.length)?.id??e[0]?.id??null}},76056:(e,t,r)=>{r.d(t,{MA:()=>o,_L:()=>a,h6:()=>i,rc:()=>n,vO:()=>l});let i=[{id:"front",label:"Front"},{id:"left",label:"Left"},{id:"back",label:"Back"},{id:"right",label:"Right"}],a=e=>"file"===e.type&&e.meta?.type==="group-four-view",n=e=>i.map((t,r)=>{let i=Array.isArray(e)?e[r]:void 0;return"string"==typeof i?i.trim():""}),l=e=>n(e).filter(Boolean),o=e=>{let t=n(e);return t[0]?t.filter(Boolean).length<2?"Add at least one more view.":Array.isArray(e)&&e.length>4?"Use up to 4 views.":null:"Add a front view."}},93836:(e,t,r)=>{r.d(t,{Gd:()=>i,Ge:()=>d,H_:()=>u,ZI:()=>m});let i={mode:"resource",source:{resourceId:"studio.loras",labelField:"name",valueField:"id",searchField:"name"}},a=e=>e&&"object"==typeof e&&!Array.isArray(e)?e:null,n=e=>"string"==typeof e?e.trim():"",l=e=>{if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e&&e.trim()){let t=Number(e);return Number.isFinite(t)?t:void 0}},o=e=>{let t=a(e.meta);return a(t?.items)},s=e=>{let t=a(e.meta),r=l(t?.maxItems??t?.max_items??t?.maxFile);if(void 0!==r&&!(r<=0))return Math.max(1,Math.floor(r))},u=e=>{let t,r;return"json"!==(t=n(e.type).toLowerCase())&&"array"!==t&&"object"!==t?null:(r=o(e),("#/components/schemas/LoraWeight"!==n(r?.$ref)?null:{pathKey:"path",scaleKey:"scale",defaultScale:1,minScale:0,maxScale:2,step:.1,maxItems:s(e)})??(e=>{var t;let r;if(r=a((t=e).meta),!("loras"===n(r?.widget).toLowerCase()||[t.id,t.label,t.help,r?.description].map(e=>n(e).toLowerCase()).filter(Boolean).join(" ").includes("lora")))return null;let i=o(e);if("object"!==n(i?.type).toLowerCase())return null;let u=a(i?.properties);if(!u)return null;let d=Object.keys(u).sort();if(2!==d.length||"path"!==d[0]||"scale"!==d[1])return null;let m=a(u.path),c=a(u.scale);if("string"!==n(m?.type).toLowerCase())return null;let p=n(c?.type).toLowerCase();if("number"!==p&&"integer"!==p)return null;let g=l(c?.minimum)??0,f=l(c?.maximum)??2,_=f>=g?f:g,y=Math.min(_,Math.max(g,l(c?.default)??1)),h=l(c?.step??c?.multipleOf)??.1;return{pathKey:"path",scaleKey:"scale",defaultScale:y,minScale:g,maxScale:_,step:h>0?h:.1,maxItems:s(e)}})(e))},d=e=>null!==u(e),m=e=>d(e)}}]);
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.